Admin duty command help (???)
#1

Hello SA-MP forums.

I've been writing a /aduty command, but I've encountered a really weird error in it. So I've wrote it, no errors.. but when I go to execute it in game it just comes up with a "я" in red. Any ideas on why this is happening, or how it can be solved? Any help is appreciated, thanks.
Код:
CMD:aduty(playerid,params[])
{
    new string[128];
   	if( GetPVarInt(playerid, "Level" ) < 1) return SendClientMessage(playerid,COLOR_GRAY,"You're not an admin!");
	if(adminduty[playerid] = 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty");
		GetPlayerName(playerid);
        SendClientMessageToAll(COLOR_RED,string);
        SetPlayerHealth(playerid,9999);
        adminduty[playerid] = 1;
        SetPlayerColor(playerid,COLOR_ORANGE);
		new Text3D:label = Create3DTextLabel("Administrator on Duty!", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
		Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
    }
    else
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetPlayerName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        adminduty[playerid] = 0;
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,100);
    }
    return 1;
}
Reply
#2

You aren't using GetPlayerName and format correctly... Read https://sampwiki.blast.hk/
Reply
#3

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
You aren't using GetPlayerName and format correctly... Read https://sampwiki.blast.hk/
Well I don't exactly see where I've gone wrong, nor do the couple people that have checked over it already. Mind telling me EXACTLY what I've done wrong?

Thanks.
Reply
#4

Sorry, I was on phone so couldn't write:
Quote:

format(string,sizeof(string),"%s has just went on Admin Duty");
GetPlayerName(playerid);

It obviously has to be
pawn Код:
format(string,sizeof(string),"%s has just went on Admin Duty",
GetPlayerName(playerid));
And that's in case if you redifined GetPlayerName. Otherwise read this.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)