04.08.2011, 05:21
i have only /sethelper 5 levels so i want to know how to stop some one if some one tries to exceed limit? and send him msg?
pawn Код:
CMD:sethelper(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 9)
{
new
giveplayerid,
level;
if(!sscanf(params, "ui", giveplayerid,level))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new
sendername[MAX_PLAYER_NAME],
giveplayername[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid, giveplayername, MAX_PLAYER_NAME);
format(string, sizeof(string), "The admin %s has made you a level %d Helper",sendername,level);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have made %s a level %d Helper",giveplayername,level);
SendClientMessage(playerid, COLOR_TOMATO, string);
PlayerInfo[giveplayerid][pHelper] = level;
}
}
else SendClientMessage(playerid, 0xAFAFAFAA, "SYNTAX:/sethelper [playerid] [level]");
}
else SendClientMessage(playerid, 0xAFAFAFAA, "You are not a Community Staff Member! Or Your Level is too low!");
}
return 1;
}