Posts: 259
Threads: 39
Joined: Jun 2017
Quote:
Originally Posted by DeStRoY232
here is the command code and it got IsPlayerAdmin already
code :
PHP код:
CMD:slap(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not allowed to use this command");
new pname[MAX_PLAYER_NAME], oname[MAX_PLAYER_NAME], otherid, string[128], Float:PPos[3];
if(sscanf(params, "u", otherid)) return SendClientMessage(playerid, COLOR_WHITE, "{FF6600}Usage: {FFFFFF}/slap [playerid/name]");
else if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, COLOR_RED, "Player isn't connected");
else
{
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(otherid, oname, sizeof(oname));
GetPlayerPos(otherid, PPos[0], PPos[1], PPos[2]);
SetPlayerPos(otherid, PPos[0], PPos[1], PPos[2]+4);
format(string, sizeof(string), "*{33ccff}[Administrator] - %s {FFFFFF}slapped {%06x}%s", pname, GetPlayerColor(playerid) >>> 8, oname);
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof(string), "You've slapped {%06x}%s{FFFFFF}(%d)", GetPlayerColor(playerid) >>> 8, oname, playerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
|
Yes thats it.
Here the disable timer for admin
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[128];
format(string, sizeof(string), "{FF6600}[DBot]: {FFFFFF}Command {FF0000}%s{FFFFFF} not found, Type {FF6600}/cmds {FFFFFF}to see server commands", cmdtext);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(success && !IsPlayerAdmin(playerid))
{
lastcommand[playerid]=gettime();
}
return 1;
}