SA-MP Forums Archive
Arm everyone? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Arm everyone? (/showthread.php?tid=96520)



Arm everyone? - Mustafacc - 08.09.2009

hello,

lately i wanted to add /armall command to my server, and i didnt want to be bothered scripting it, so i got the command from V admin by Yaheli
heres the command from the V admin

Код:
  if(strcmp(cmd, "/giveallgun", true) == 0)
	{
	  if(PlayerInfo[playerid][pAdmin] < 6) return DenyMessage(playerid, 6);
 		new tmp2[256];
	  tmp = strtok(cmdtext, idx);
   	new gun = strval(tmp);
   	tmp2 = strtok(cmdtext, idx);
   	new ammo = strval(tmp2);
   	if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveallgun [weaponid] [ammo]");
		if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveallgun [weaponid] [ammo]");
 		for(new i = 0; i <= MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			  GivePlayerWeapon(i, gun, ammo);
		}
		return 1;
	}
	#endif
and i turned it into this

Код:
  if(strcmp(cmd, "/giveeveryonegun", true) == 0)
	{
	  if(PlayerInfo[playerid][pAdminLevel] >= 4) return (playerid, 6);
 		new tmp2[256];
	  tmp = strtok(cmdtext, idx);
   	new gun = strval(tmp);
   	tmp2 = strtok(cmdtext, idx);
   	new ammo = strval(tmp2);
   	if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveallgun [weaponid] [ammo]");
		if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveallgun [weaponid] [ammo]");
 		for(new i = 0; i <= MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			  GivePlayerWeapon(i, gun, ammo);
		}
		return 1;
	}
well i tested it and it worked fine, but after 1 usage the command is not valid anymore.
why is that?