Help with /kick command. -
Here is my command:
Код:
COMMAND:kick(playerid, params[]) //using ZCMD this is how your command will start off looking like.
{
if(PlayerInfo[playerid][pAdmin] <= 2)
{
new otherplayerid, reason[128];
if(sscanf(params, "uz", otherplayerid, reason)) // split input string and check level value 0 to 5
SendClientMessage(playerid, 0xFFFFFFFF, "/kick [playerid/name] [reason]");
else if(otherplayerid == INVALID_PLAYER_ID) // Check player connected
SendClientMessage(playerid, 0xFFFFFFFF, "This player is not connected");
else
{
new string[32];
format(string, sizeof(string), "Admin %s kicked %s | Reason: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(otherplayerid), reason);
SendClientMessageToAll(0xFFFFFFFF,string);
Kick(otherplayerid);
}
}
else
{
SendClientMessage(playerid, 0xAAAAAAAA, "You are not admin or the required level.");
}
return 1;
}
I get this error:
Код:
C:\Users\admin\Desktop\Server\gamemodes\Server.pwn(884) : error 017: undefined symbol "GetPlayerNameEx"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
When I remove the Ex at the end of 'GetPlayerNameEx' I get these warnings:
Код:
C:\Users\admin\Desktop\Server\gamemodes\Server.pwn(884) : warning 202: number of arguments does not match definition
C:\Users\admin\Desktop\Server\gamemodes\Server.pwn(884) : warning 202: number of arguments does not match definition
C:\Users\admin\Desktop\Server\gamemodes\Server.pwn(884) : warning 202: number of arguments does not match definition
C:\Users\admin\Desktop\Server\gamemodes\Server.pwn(884) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Warnings.
Re: Help with /kick command. -
pawn Код:
COMMAND:kick(playerid, params[]) //using ZCMD this is how your command will start off looking like.
{
if(PlayerInfo[playerid][pAdmin] <= 2)
{
new adminname[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],otherplayerid, reason[128];
GetPlayerName(otherplayerid,pname,sizeof(pname));
GetPlayerName(playerid,adminname,sizeof(adminname));
if(sscanf(params, "uz", otherplayerid, reason))
SendClientMessage(playerid, 0xFFFFFFFF, "/kick [playerid/name] [reason]");
else if(otherplayerid == INVALID_PLAYER_ID)
SendClientMessage(playerid, 0xFFFFFFFF, "This player is not connected");
else
{
new string[32];
format(string, sizeof(string), "Admin %s kicked %s | Reason: %s",adminname,pname, reason);
SendClientMessageToAll(0xFFFFFFFF,string);
Kick(otherplayerid);
}
}
else
{
SendClientMessage(playerid, 0xAAAAAAAA, "You are not admin or the required level.");
}
return 1;
}
Re: Help with /kick command. -
Thankyou heaps. Really appreciated. Rep +1
Re: Help with /kick command. -