CMD:setvip(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new string[125], level, player1; if(sscanf(params,"dd",player1, level)) return SendClientMessage(playerid, RED,"[USAGE]: /setvip ( playerid ) ( level )"); if(!IsPlayerConnected(playerid) && player1 != INVALID_PLAYER_ID) { SendClientMessage(playerid, RED,"[ERROR]: Player is not connected"); } if(level > MAX_VIPL) { SendClientMessage(playerid, RED,"[ERROR]: Incorrect level"); } else { format(string, sizeof(string),""cblue"Administrator "cgreen"'%s' "cblue"has set your vip level to "cgreen"'%d'", PlayerName(playerid),level); SendClientMessage(player1, PURPLE, string); PlayerPlaySound(player1,1057,0.0,0.0,0.0); PlayerInfo[player1][pVIP] = level; } } else return SendClientMessage(playerid, RED,"[ERROR]: You need to be RCON admin to use this command"); return 1; }
format(string,sizeof(string),"You gave VIP level %d to %d player.",level,player1); SendClientMessage(playerid,0xFFFFFFFF,string);
CMD:setvip(playerid, params[])
{
new admsg[128];
if(IsPlayerAdmin(playerid))
{
new string[125], level, player1;
if(sscanf(params,"dd",player1, level)) return SendClientMessage(playerid, RED,"[USAGE]: /setvip ( playerid ) ( level )");
if(!IsPlayerConnected(playerid) && player1 != INVALID_PLAYER_ID)
{
SendClientMessage(playerid, RED,"[ERROR]: Player is not connected");
}
if(level > MAX_VIPL)
{
SendClientMessage(playerid, RED,"[ERROR]: Incorrect level");
}
else
{
format(string, sizeof(string),""cblue"Administrator "cgreen"'%s' "cblue"has set your vip level to "cgreen"'%d'", PlayerName(playerid),level);
SendClientMessage(player1, PURPLE, string);
PlayerPlaySound(player1,1057,0.0,0.0,0.0);
PlayerInfo[player1][pVIP] = level;
//>Format "admsg"
format(admsg,sizeof(admsg),"[Admin Message]: You Gave Vip Level %d To Playerid %d",level, player1);
//>Send it to playerid (someone that used command)
SendClientMessage(playerid,-1,admsg);
}
}
else return SendClientMessage(playerid, RED,"[ERROR]: You need to be RCON admin to use this command");
return 1;
}
format(string,sizeof(string),"You gave VIP level %d to %s player.",level,PlayerName(player1)); SendClientMessage(playerid,0xFFFFFFFF,string);
Код:
format(string,sizeof(string),"You gave VIP level %d to %s player.",level,PlayerName(player1)); SendClientMessage(playerid,0xFFFFFFFF,string); |
Код:
format(string,sizeof(string),"You gave VIP level %d to %s player.",level,PlayerName(player1)); SendClientMessage(playerid,0xFFFFFFFF,string); |
stock PlayerName(playerid)
{
new
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
he have to define PlayerName because it isn't defined by default
put it somewhere in your script pawn Код:
|