28.06.2016, 07:25
PHP код:
error 035: argument type mismatch (argument 2)
PHP код:
error 035: argument type mismatch (argument 2)
PHP код:
COMMAND:ban(playerid, params[])
{
new TargetID, string[256], Reason[256];
if(PlayerInfo[playerid][pSpawned] == 1)
{
if(PlayerInfo[playerid][pAdminlevel] > 0)
{
if(sscanf(params, "u", TargetID))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /ban (Name - ID) (Reason)");
return 1;
}
sscanf(params, "us[256]", TargetID, Reason);
if(!IsPlayerConnected(TargetID) || TargetID == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_ERROR, "That Player Is Not Connected.");
return 1;
}
if(IsPlayerNPC(TargetID))
{
SendClientMessage(playerid,COLOR_ERROR,"You Cannot Ban a BOT.");
return 1;
}
if(!strlen(Reason))
{
Reason = "No Reason Given.";
}
SetPlayerPosEx(TargetID,264.905700, 77.614082, 1001.039062, 269.327789,6,0);
SendClientMessage(playerid, "You Have Been Banned By An Admin. Reason: %s", Reason);
format(string,sizeof(string),"**BAN: %s (%d) (ADMIN BAN) Has Been Banned.", PlayerInfo[TargetID][pName], TargetID);
SendClientMessageToOthers(COLOR_ADMIN, string);
BanPlayer(TargetID);
}else{
SendClientMessage(playerid,COLOR_ERROR,""ERROR_MSG"");
}
}else{
SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While You're Dead.");
}
return 1;
}