23.11.2014, 20:55
Hi me have a question
Why does this not armoured all players?
And why does this not heal all players?
Thx for reading
Why does this not armoured all players?
pawn Код:
CMD:armourall(playerid, params[])
{
new str[128];
if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_ORANGE, "** You are not logged in, please login first.");
if(PlayerAcc[playerid][Admin] == 0) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 4+ can do that command.");
if(PlayerAcc[playerid][Admin] >= 4)
{
SetPlayerArmour(playerid, 100.0);
format(str, sizeof(str), "~g~Free Armour!");
GameTextForAll(str, 4000, 3);
foreach(Player, i)
{
if(IsPlayerConnected(i) && (i != playerid) && (PlayerAcc[playerid][Admin] < PlayerAcc[i][Admin]))
{
SetPlayerArmour(i, 100.0);
}
}
GameTextForAll("~g~FREE ARMOUR", 3000, 3);
format(str, sizeof(str), "** Admin %s(ID:%d) has armoured all players.", GetName(playerid), playerid);
SendClientMessageToAll(COLOR_YELLOW, str);
SendClientMessage(playerid, COLOR_YELLOW, "** You armoured all players.");
}
else return ErrorMessages(playerid, 8);
return 1;
}
pawn Код:
CMD:healall(playerid, params[])
{
new str[128];
if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_ORANGE, "** You are not logged in, please login first.");
if(PlayerAcc[playerid][Admin] == 0) return SendClientMessage(playerid, -1,""orange"** Sorry, only admins level 4+ can do that command.");
if(PlayerAcc[playerid][Admin] >= 4)
{
foreach(Player, i)
{
if(IsPlayerConnected(i) && (i != playerid) && (PlayerAcc[playerid][Admin] < PlayerAcc[i][Admin]))
{
SetPlayerHealth(i, 100.0);
}
}
GameTextForAll("~g~FREE HEALTH!", 3000, 3);
format(str, sizeof(str), "** Admin %s(ID:%d) has healed all players.", GetName(playerid), playerid);
SendClientMessageToAll(COLOR_YELLOW, str);
SendClientMessage(playerid, COLOR_YELLOW, "** You have been succesfully healed all players.");
}
else return ErrorMessages(playerid, 8);
return 1;
}