Admin - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin (
/showthread.php?tid=229930)
Admin -
Franklyn - 22.02.2011
Hello. I have /aod script like this, but it doesen't make dot on minimap where i am. Can someone teach me to do it, when i write /aod it will say i'm admin on duty and it will make dot on minimap, if i write it again, it says i'm not admin on duty and removes dot from minimap.
pawn Код:
if(strcmp(cmd, "/aod", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new faction = PlayerInfo[playerid][pFaction];
if(AdminDuty[playerid] == 1)
{
format(string, sizeof(string), "[Admin:] %s (ID:%d) is now off duty", GetPlayerNameEx(playerid),playerid);
SendClientMessageToAll(COLOR_ADMINDUTY,string);
AdminDuty[playerid] = 0;
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
if(PlayerInfo[playerid][pFaction] != 255)
{
if(DynamicFactions[faction][fUseColor])
{
SetPlayerToFactionColor(playerid);
}
else
{
SetPlayerColor(playerid,COLOR_CIVILIAN);
}
}
else
{
SetPlayerColor(playerid,COLOR_CIVILIAN);
}
}
else
{
format(string, sizeof(string), "[Admin:] %s (ID:%d) is now admin on duty", GetPlayerNameEx(playerid),playerid);
SendClientMessageToAll(COLOR_ADMINDUTY,string);
AdminDuty[playerid] = 1;
SetPlayerColor(playerid,COLOR_ADMINDUTY);
SetPlayerHealth(playerid,999);
SetPlayerArmour(playerid,999);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Viga:] You are not admin");
}
return 1;
}
Re: Admin -
Anteino - 22.02.2011
EDIT: nevermind about that, I might respond later
EDIT: try this
pawn Код:
#include <a_samp>
#include "../include/gl_common.inc"
#define FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFFF
new PlayerMarker[MAX_PLAYERS];
public OnPlayerSpawn(playerid){
PlayerMarker[playerid] = -1;
SetPlayerColor(playerid, 0x00000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp("/aod", cmd, true) == 0){
PlayerMarker[playerid] = PlayerMarker[playerid] * -1;
if(PlayerMarker[playerid] == 1) return SetPlayerColor(playerid, 0x000000FF);
if(PlayerMarker[playerid] == -1) return SetPlayerColor(playerid, 0x00000000);
}
return 1;
}
public OnGameModeInit()
{
ShowPlayerMarkers(1);
return 1;
}