17.02.2015, 18:42
Hello. I was making my admin script and i get some error when compile it:
I really don't know what is the problem. First it was in brackets (10 errors),and i fixed it and I am still thinking that it is problem in brackets ? :P
<-- 216 line
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
//===========================( Admin komande )===========================
COMMAND:setlevel(playerid,params[])
{
new id,level,msg[128],msg2[128],name[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid, 0xFFFFFF,"Koristenje: /setlevel (Ime/ID) (Level)");
else if(level > 5) return SendClientMessage(playerid, 0xFFFFFF,"Error: Maximalni level admin je 5.");
else
{
PlayerInfo[id][pAdministrator] = level;
format(msg,sizeof(msg),"Cestitamo! Sada ste admin na levelu %d",level);
SendClientMessage(id,0xFFFFFF,msg);
GetPlayerName(id,name,sizeof(name));
format(msg2,sizeof(msg2),"Postavili ste admina %s na levelu %d", name,level);
SendClientMessage(playerid,0xFFFFFF,msg2);
}
}
else
{
SendClientMessage(playerid,0xFFFFFF,"Error: Nemate dozvolu za tu komandu!");
}
return 1;
}
PHP код:
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(216) : error 029: invalid expression, assumed zero
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(238) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
PHP код:
COMMAND:setlevel(playerid,params[])