SA-MP Forums Archive
armourall - 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)
+--- Thread: armourall (/showthread.php?tid=453954)



armourall - BoU3A - 27.07.2013

Hello. This Cmd doesn't work Help Please.

Код:
CMD:armourall(playerid, params[])
{
	new str[128];
	if(pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, COLOR_RED, "[Error]: You must be logged in!");
	if(pInfo[playerid][Admin] >= 4)
	{
		SendAdminCMD(playerid, "armourall", 0);
	   	for(new i = 0; i < MAX_PLAYERS; i++)
  		{
			if(IsPlayerConnected(i) && (i != playerid) && (pInfo[playerid][Admin] > pInfo[i][Admin]) && InDM[i] == 0)
			{
				PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
				SetPlayerArmour(i, 100.0);
			}
		}
		PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
		format(str, sizeof(str), "Administrator %s(%d) has armoured all players!", GetName(playerid), playerid);
		SendClientMessageToAll(COLOR_YELLOW, str);
	}
	else return SendClientMessage(playerid, COLOR_RED, EACMD);
	return 1;



Re: armourall - BoU3A - 27.07.2013

!!!!!!!!!!!!!!!


Re: armourall - Scottas - 27.07.2013

do you get any message?


Re: armourall - CrazyChoco - 27.07.2013

What does it exactly do when you enter the command?
Otherwisen I might Got a solution, chance the player Sound and setarmour from 'i' to playerid

I could have written an example but i'm currently on phone.


Re: armourall - Scottas - 27.07.2013

Quote:
Originally Posted by CrazyChoco
Посмотреть сообщение
What does it exactly do when you enter the command?
Otherwisen I might Got a solution, chance the player Sound and setarmour from 'i' to playerid

I could have written an example but i'm currently on phone.
But then it will play sound and set armor for player, who typed command only.

Try to add ( ) on the last statement:
pawn Код:
if(IsPlayerConnected(i) && (i != playerid) && (pInfo[playerid][Admin] > pInfo[i][Admin]) && (InDM[i] == 0))



Re: armourall - Konstantinos - 27.07.2013

You need to provide details on what happens.

"This Cmd doesn't work"

Note that if you test it and you're the only one connected, then you won't get armour. The command does what it was meant to do. Setting everyone's health who are connected, not the player who typed the command, lower level the player who typed the command and they are not in any DM.


Re: armourall - BoU3A - 27.07.2013

if i do it i dont got any armour i see message admin.. has armourd all player and sond but i dont got armour

sorry im newbie


Re: armourall - Captain_Mani - 28.07.2013

Try this

Код:
CMD:armourall(playerid, params[])
{
	new str[128];
	if(pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, COLOR_RED, "[Error]: You must be logged in!");
	if(pInfo[playerid][Admin] >= 4)
	{
		SendAdminCMD(playerid, "armourall", 0);
	   	for(new i = 0; i < MAX_PLAYERS; i++)
  		{
			if(IsPlayerConnected(i) && (i != playerid) && (pInfo[playerid][Admin] > pInfo[i][Admin]) && InDM[i] == 0)
			{
				PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
				SetPlayerArmour(i, 100.0);
			}
		}
		PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                SetPlayerArmour(i, 100.0);
		format(str, sizeof(str), "Administrator %s(%d) has armoured all players!", GetName(playerid), playerid);
		SendClientMessageToAll(COLOR_YELLOW, str);
	}
	else return SendClientMessage(playerid, COLOR_RED, EACMD);
	return 1;