Command of adminjail -
Zeus666 - 30.06.2016
Код:
error 035: argument type mismatch (argument 2)
if (pInfo[playerid][pAdminLevel] < 1)
return SendClientMessage(playerid, "You are not Admin.");
Код:
error 035: argument type mismatch (argument 2)
SendClientMessageToAll(COLOR_GREEN, "** %s is now Admin Duty (/report for assistance).", GetPlayerName(playerid, 0));
Код:
warning 202: number of arguments does not match definition
new targetid, time, reason[64], randomnr;
randomnr = random(2, 100);
Код:
error 001: expected token: ";", but found "if"
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorizedr!");
Код:
error 001: expected token: ")", but found "return"
if(sscanf(params, "u", targetid) return SendClientMessage(playerid, -1, "USAGE: /unajail <playerid>");
Im beginner in script. I follow a tutorial.
Re: Command of adminjail -
Stinged - 30.06.2016
1: Show us your enum.
2: You can't use SendClientMessageToAll like that.
You have to use
format.
3:
Random only has 1 argument.
4: There's a
; missing in the line above.
5: You have a missing ), because yours is like this: if ( sscanf( )
And it should be like this: if ( sscanf ( ) )
Re: Command of adminjail -
Zeus666 - 30.06.2016
1.
Код:
enum playerinfo
{
pAdminLevel
}
4. Resolved it.
Re: Command of adminjail -
Shinja - 30.06.2016
Why you need random virtualworlds? one is enough for all jailed players
And, show use whole command
Have you tried the command i gave you in first post?
Re: Command of adminjail -
Stinged - 30.06.2016
Oh sorry, I just noticed the first error.
There's a color argument missing in SendClientMessage.
It should be in the middle.
Quote:
Originally Posted by Zeus666
4. Resolved it.
|
You didn't solve anything else? I posted all of the solutions.
Re: Command of adminjail -
Zeus666 - 30.06.2016
I tried.
Код:
CMD:aduty(playerid, params[])
{
if (pInfo[playerid][pAdminLevel] < 1)
return SendClientMessage(playerid, "You are not Admin.");
if (!pInfo[playerid][pAdminDuty])
{
SetPlayerColor(playerid,COLOR_RED);
pInfo[playerid][pAdminDuty] = 1;
new string[128]
format(string, sizeof(string), "COLOR_RED" "%s is now Admin Duty. Use (/report) to ask help",GetPlayerName(playerid, 0));
SendClientMessageToAll(-1,string);
}
else
{
SetPlayerColor(playerid, COLOR_WHITE);
pInfo[playerid][pAdminDuty] = 0;
SendClientMessage(playerid,COLOR_GREEN, "You are no longer on admin duty.");
}
return 1;
}
Код:
error 001: expected token: ";", but found "-identifier-"
error 035: argument type mismatch (argument 2)
format(string, sizeof(string), "COLOR_RED" "%s is now Admin Duty. Use (/report) to ask help",GetPlayerName(playerid, 0));
only this error i can't manage, the rest of it i've managed to fix it
Re: Command of adminjail -
Stinged - 30.06.2016
Код:
new string[128]
format(string, sizeof(string), "COLOR_RED" "%s is now Admin Duty. Use (/report) to ask help",GetPlayerName(playerid, 0));
Change it to:
Код:
new string[128];
GetPlayerName(playerid, string);
format(string, sizeof(string), "{FF0000}%s is now Admin Duty. Use (/report) to ask help", string);
The second one is just a warning, fix it by indentation.
https://en.wikipedia.org/wiki/Indent_style
Re: Command of adminjail -
Zeus666 - 30.06.2016
warning 202: number of arguments does not match definition
Re: Command of adminjail -
Stinged - 30.06.2016
Which line? If it's this:
Код:
SendClientMessage(playerid, "You are not Admin.");
It should be like this:
Код:
SendClientMessage(playerid, YOUR COLOR HERE, "You are not Admin.");
Re: Command of adminjail -
Zeus666 - 30.06.2016
Your line.
Код:
new string[128];
GetPlayerName(playerid, string);
format(string, sizeof(string), "{FF0000}%s is now Admin Duty. Use (/report) to ask help", string);
tried it, gave error.
tried
Код:
new string[128];
GetPlayerName(playerid, string);
format(string, sizeof(string), "{FF0000} %s is now Admin Duty. Use (/report) to ask help",GetPlayerName(playerid,string);
gave more errors.