29.12.2010, 20:19
so here is my admin kick
and this is line the error is
I think I did a mistake with admin name and the params..
and also how can I change example the admin chat from # to /a or something else? Currently the admin chat is under OnPlayerText, should I just make it out of dcmd and put it under onplayercommandtext?
pawn Код:
dcmd_kick(playerid, params[])
{
new pid;
if(sscanf(params, "us", pid, params[2])) return SendClientMessage(playerid, Yellow, "Command Usage: /kick <playerid> <reason>");
if(level[playerid] >= 1)
{
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, Red, "Player is not connected");
new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180];
GetPlayerName(pid, paramname, sizeof(paramname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(string, sizeof(string), "%s has been kicked by %s for: %s", paramname, adminname, params[2]);
SendClientMessageToAll(AdminColor, string);
SendClientMessage(pid, AdminColor, "You have been kicked by %s for: %s", adminname, params[2]);
Kick(pid);
} else return 0;
return 1;
}
pawn Код:
SendClientMessage(pid, AdminColor, "You have been kicked by %s for: %s", adminname, params[2]);
pawn Код:
E:\GTA San Andreas\Server\gamemodes\DMTest.pwn(333) : warning 202: number of arguments does not match definition
E:\GTA San Andreas\Server\gamemodes\DMTest.pwn(333) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
and also how can I change example the admin chat from # to /a or something else? Currently the admin chat is under OnPlayerText, should I just make it out of dcmd and put it under onplayercommandtext?