16.04.2013, 15:19
I am not sure how and why you use those loops. You want to be only you that will set all vips' colors? Anyway this is what it is with loop. If it doesnt work, tell me to make the commands personal.
pawn Код:
new SavedColor[MAX_PLAYERS];
CMD:vcoloron(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(gPlayerInfo[i][PLAYER_VIP] < 1)return SendClientMessage(i, COLOR_RED, "You are Not Allowed To Use This Command!");
if(gPlayerInfo[i][PLAYER_VIP] == 1)
{
SavedColor[i]=GetPlayerColor(i);
SetPlayerColor(i, COLOR_BRONZE);
}
else if(gPlayerInfo[i][PLAYER_VIP] == 2)
{
SavedColor[i]=GetPlayerColor(i);
SetPlayerColor(i, COLOR_SILVER);
}
else
{
SavedColor[i]=GetPlayerColor(i);
SetPlayerColor(i, COLOR_GOLD);
}
SendClientMessage(i, COLOR_LIGHTBLUE, "[VIP]: You Have Enabled a Vip Color!");
}
return 1;
}
CMD:vcoloroff(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
SetPlayerColor(i, SavedColor[i]);
}
return 1;
}