31.12.2010, 16:10
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..
also should I put return 0; on the last onplayercommand cmd?
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;
}