Admin duty command help (???) - 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)
+--- Thread: Admin duty command help (???) (
/showthread.php?tid=435203)
Admin duty command help (???) -
Diego_Martinz - 05.05.2013
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;
}
Re: Admin duty command help (???) -
[MG]Dimi - 05.05.2013
You aren't using GetPlayerName and format correctly... Read
https://sampwiki.blast.hk/
Re: Admin duty command help (???) -
Diego_Martinz - 05.05.2013
Quote:
Originally Posted by [MG]Dimi
|
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.
Re: Admin duty command help (???) -
[MG]Dimi - 06.05.2013
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.