[SOLVED] /adminize compile errors
#1

Theres some errors with my 'make admin' command!

I think it has to do with 'new result[256];' under 'OnPlayerCommandText'

pawn Код:
if (strcmp(cmd, "/adminize", true) == 0)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAY, "[!] USAGE: /adminize [playerid] [admin level]");
return 1;
}
new level;
new playa = strval(tmp);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
level = strval(tmp);
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 5)
{
format(string, sizeof(string), "[!] Admin %s has promoted you to a level %s admin!"sendername, result); //LINE 360 !!
SendClientMessage(playa, COLOR_GREEN, string);
format(string, sizeof(string), "[!] You have promoted %s to a level %s admin!"giveplayr, result);
SendClientMessage(playerid, COLOR_GREEN, string);
PlayerInfo[playa][pAdmin] = level;
}
return 1;
}
Код:
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(360) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(360) : warning 215: expression has no effect
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(360) : warning 215: expression has no effect
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(360) : error 001: expected token: ";", but found ")"
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(360) : error 029: invalid expression, assumed zero
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(360) : fatal error 107: too many error messages on one line
Thanks in advance
Reply
#2

You need a comma after the end of the strings (Change "blabla to ", blabla).
Reply
#3

format(string, sizeof(string), "[!] Admin %s has promoted you to a level %s admin!", sendername, result); //LINE 360 !!

try that
Reply
#4

Lmfao, thanks guys. Simple mistakes that change the world
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)