Posts: 3,351
Threads: 780
Joined: Jan 2010
Hi all,i need a simple command:
/giveweaponall WEAP ID AMMO
If i use that i command,i give specified weapon at all players on the server.
Thanks
Posts: 6,129
Threads: 36
Joined: Jan 2009
pawn Код:
CMD:giveweaponall(playerid, params[]) {
if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Syntax: /giveweaponall [weaponid]");
for(new i; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) GivePlayerWeapon(i, strval(params), 99999);
}
}
You need ZCMD to use this. Anyone on the server can use the command above ^, it gives infinite ammo with the weaponid you add when you type /giveweaponall.
pawn Код:
CMD:giveweaponall(playerid, params[]) {
if(!IsPlayerAdmin(playerid)) return 1;
if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Syntax: /giveweaponall [weaponid]");
for(new i; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) GivePlayerWeapon(i, strval(params), 99999);
}
}
The code above requires the person who types the command to have RCON admin, if they are not RCON admin, nothing happens when they type the command.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Can u setup methe cmd with strcmp?
Posts: 3,351
Threads: 780
Joined: Jan 2010