13.07.2013, 22:51
im getting these errors :
with this code.
Код:
C:\Documents and Settings\Owner\Desktop\test\gamemodes\DDPTDM.pwn(746) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Owner\Desktop\test\gamemodes\DDPTDM.pwn(748) : error 033: array must be indexed (variable "id") C:\Documents and Settings\Owner\Desktop\test\gamemodes\DDPTDM.pwn(750) : error 033: array must be indexed (variable "id") C:\Documents and Settings\Owner\Desktop\test\gamemodes\DDPTDM.pwn(756) : error 033: array must be indexed (variable "id") C:\Documents and Settings\Owner\Desktop\test\gamemodes\DDPTDM.pwn(762) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
pawn Код:
CMD:setlevel(playerid,params[])
{
if(SInfo[playerid][pAdmin] < 4&& !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"You don't have the permission to use this command!");
new id[32],level,string1[256],string2[256],string3[256],string4[256];if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /setlevel [playerid] [level 0/3]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_ERROR,"Player not connected."); //Error line 746
if(level > 5) return SendClientMessage(playerid,COLOR_ERROR,"Error! You can only pick between level 0/5 (0: Player - 1: Mini Moderator - 2: Moderator - 3: Mini Administrator - 4: Administrator - 5: Server Owner)");
if(SInfo[id][pAdmin] < level)// Error line 748
{
SInfo[id][pAdmin] = level;// Error line 750
format(string1,sizeof string1, "You have promoted %s succesfully to level %i.",id,level);
SendClientMessage(playerid, COLOR_GREEN, string1);
format(string2,sizeof string2, "Congratulations! You have been promoted to level %i.",level);
SendClientMessage(playerid, COLOR_GREEN, string2);
} else {
SInfo[id][pAdmin] = level;// error line 756
format(string3,sizeof string3,"You have demoted %s succesfully to level %i.",id, level);
SendClientMessage(playerid, COLOR_GREEN, string3);
format(string4,sizeof string4,"You have been demoted to level %i.",level);
SendClientMessage(playerid, COLOR_GREEN, string4);
}
SaveUser(id);//Error line 762
return 1;
}