No commands working
#1

Why doesnt any admin/afk commands working? I've put it all in one gamemode and made dcmd.. Ive not used zcmd or anything else...

Here is an example how my admin commands looks like..

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    dcmd(explode, 6, cmdtext);
    return 0;
}
pawn Код:
dcmd_explode(playerid, params[])
{
    new pid;
    if(sscanf(params, "u", pid)) return SendClientMessage(playerid, Yellow, "Usage: /explode <playerid>");
    if(level[playerid] >= 3)
    {
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, Red, "This player is not connected");
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(pid, X, Y, Z);
    CreateExplosion(X, Y, Z, 2, 10);
    SetPlayerArmour(pid, 0);
    SetPlayerHealth(pid, 0);
    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), "Admin %s has exploded %s", adminname, paramname);
    MessageToAdmins(AdminColor, string);
    } else SendClientMessage(playerid, White, "SERVER: Unknown command.");
    return 1;
}
also should I put return 0; on the last onplayercommand cmd?
Reply


Messages In This Thread
No commands working - by xir - 31.12.2010, 16:10
Re: No commands working - by <Weponz> - 31.12.2010, 16:15
Re: No commands working - by HyperZ - 31.12.2010, 17:21
Re: No commands working - by Mean - 31.12.2010, 21:32
Re: No commands working - by xir - 01.01.2011, 09:36
Re: No commands working - by Kwarde - 01.01.2011, 10:26

Forum Jump:


Users browsing this thread: 4 Guest(s)