dcmd_promote(playerid, params[])
{
new id, level;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params,"ud",id,level) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /promote <ID/Name> <Level>");
}
else
{
if(level > 3) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: Invalid level. Max level is 3.");
}
else
{
new INI:File = INI_Open(UserPath(id));
INI_WriteInt(File,"Admin",level);
INI_Close(File);
}
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not authorized to use this command.");
}
}
dcmd_kick(playerid, params[])
{
new id, reason[128],name[MAX_PLAYER_NAME];
new string1[128];
if(PlayerInfo[playerid][pAdmin] > 1)
{
if(sscanf(params,"us[128]",id,reason); return SendClientMessage(playerid, COLOR_ERROR, "Error!");
else
{
format(string1,sizeof(string1),"%s has been kicked from the server! - %s", GetPlayerName(id,name,sizeof(name)),reason);
SendClientMessageToAll(0xFFFFFF,string1);
Kick(id);
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not authorized to use this command!");
}
}
dcmd_promote(playerid, params[])
{
new id, level;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not authorized to use this command.");
if(sscanf(params, "ud", id, level) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /promote <ID/Name> <Level>");
if(level > 3) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: Invalid level. Max level is 3.");
new INI:File = INI_Open(UserPath(id));
INI_WriteInt(File,"Admin",level);
INI_Close(File);
return 1;
}
dcmd_kick(playerid, params[])
{
new id, reason[128],name[MAX_PLAYER_NAME];
new string1[128];
if(PlayerInfo[playerid][pAdmin] > 1)
{
if(sscanf(params, "us[128]", id, reason) return SendClientMessage(playerid, COLOR_ERROR, "Error!");
format(string1, sizeof(string1), "%s has been kicked from the server! - %s", GetPlayerName(id,name,sizeof(name)), reason);
SendClientMessageToAll(0xFFFFFF, string1);
Kick(id);
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "ERROR: You're not authorized to use this command!");
}
return 1;
}
C:\Users\USER\Desktop\Street Kings Server\gamemodes\SKCNR.pwn(12867) : error 001: expected token: ")", but found "return" C:\Users\USER\Desktop\Street Kings Server\gamemodes\SKCNR.pwn(12881) : error 001: expected token: ")", but found "return" |
if(sscanf(params, "ud", id, level) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /promote <ID/Name> <Level>");
if(sscanf(params, "us[128]", id, reason) return SendClientMessage(playerid, COLOR_ERROR, "Error!");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /promote <ID/Name> <Level>");
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ERROR, "Error!");