AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   give_item to all players (https://forums.alliedmods.net/showthread.php?t=143403)

m_pro_m 11-19-2010 10:25

give_item to all players
 
Hi, i am new in this forum ...
I speak English only little :(

Here is my problem :
Code:

give_item(id , "weapon_m4a1")
When I wanted that m4a1 will have all players, I changed id to 0 .
But it doesnt work :(
What I must do ?

Arkshine 11-19-2010 10:35

Re: give_item to all players
 
Loop through all players.

hleV 11-19-2010 10:38

Re: give_item to all players
 
Basically when a native doesn't support index 0 as all players, you make a loop:
Code:
new players[32], count; get_players(players, count, "a");   for (new i; i < count; i++)         give_item(players[i], "weapon_m4a1");
This will go through all alive players and give them M4A1.

Leon_12 11-19-2010 10:45

Re: give_item to all players
 
if you use id its only for one player not for all if you use player or players i'm not sure you'll give to all players

m_pro_m 11-19-2010 11:01

Re: give_item to all players
 
Thank YOU !

It was helpful :)


All times are GMT -4. The time now is 11:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.