31.03.2013, 15:45
Its from a FS i downloaded
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/setvip", cmdtext, true, 7) == 0)
{
if(IsPlayerAdmin(playerid))
{
new Target;
new VLevel;
new levelerror[100];
format(levelerror,sizeof(levelerror),"{FF0000}ERROR: {FFFFFF}Maximum level is {FFFF00}%d!",MaxLevel);
if(!sscanf(params, "ui",Target,VLevel))////<----PROBLEM
{
if(VLevel > MaxLevel) return SendClientMessage(playerid, COLOR_RED, levelerror);
if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}Wrong player ID!");
PlayerData[Target][Level] = VLevel;
new tname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
new MyString[128];
format(MyString, sizeof(MyString), "{00FF40}SUCCES: {FFFFFF}You have set {FFFF00}%s {FFFFFF}VIP Level to {FFFF00}%i!", tname, VLevel);
SendClientMessage(playerid,COLOR_GREEN,MyString);
if(PlayerData[Target][Level] > 0)
{
TotalAccounts++;
format(File,sizeof(File),"/fVIP/Accounts/%s.txt",tname);
if(dini_Exists(File))
{
dini_IntSet(File,"AccountNumber",TotalAccounts);
}
}
else if(PlayerData[playerid][Level] == 0)
{
TotalAccounts--;
format(File,sizeof(File),"/fVIP/Accounts/%s.txt",tname);
if(dini_Exists(File))
{
dini_Set(File,"AccountNumber","N/A");
}
}
}
else SendClientMessage(playerid, COLOR_YELLOW, "{FF0000}USAGE: {FFFFFF}/setvip <playerid> <vip-level>");
}
else SendClientMessage(playerid,COLOR_RED,"{FF0000}ERROR: {FFFFFF}You are not RCON Administrator!");
return 1;
}
return 0;
}

