Setlevel command problem
#1

Hey, I have got a problem in my /setlevel command. I have got errors, lines where are they are marked with [ b ]

Errors:

...Gamemode.pwn(42 : error 033: array must be indexed (variable "level")
...Gamemode.pwn(429) : error 033: array must be indexed (variable "level")
...Gamemode.pwn(430) : error 006: must be assigned to an array
...Gamemode.pwn(431) : error 035: argument type mismatch (argument 3)

Here's the code:

Код:
dcmd_setlevel(playerid,params[])
{
    if(level[playerid] >= 5)
    {
		new playerid2, string[128];
    	if(!sscanf(params, "ud", playerid2, level))
    	{
         	if(IsPlayerConnected(playerid2))
       		{
    			new playerfile[128];
				new tmp[128], tmp2[128], Index;
				tmp = strtok(params,Index), tmp2 = strtok(params,Index),playerid2 = strval(tmp),level = strval(tmp2);
				if(level >= 6) return SendClientMessage(playerid,red,"ERROR: Incorrect level! Please choose beetween 0 and 5!");
				level[playerid] = level;
				dini_IntSet(playerfile,"Level",level);
				format(string,sizeof(string),"You have set %s's Administrator Level to %d!",GetName(playerid2),level);
				SendClientMessage(playerid,red,string);
				format(string,sizeof(string),"Administrator %s has set your Administrator Level to %d!",GetName(playerid),level);
				SendClientMessage(playerid2,red,string);
        	}
        	else return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
    	}
    	else return SendClientMessage(playerid,red,"USAGE: /setlevel [playerid] [level]");
    }
	else return SendClientMessage(playerid,red,"ERROR: Only Admins with level 5 can use this command!");
	return 1;
}
Anyway, thanks for the help.
Reply


Messages In This Thread
Setlevel command problem - by Libra_PL - 26.02.2011, 07:13
Re: Setlevel command problem - by [WF]Demon - 26.02.2011, 07:44
Re: Setlevel command problem - by Libra_PL - 26.02.2011, 07:55
Re: Setlevel command problem - by armyoftwo - 26.02.2011, 08:33
Re: Setlevel command problem - by Libra_PL - 26.02.2011, 08:51
Re: Setlevel command problem - by armyoftwo - 26.02.2011, 08:56
Re: Setlevel command problem - by Libra_PL - 26.02.2011, 09:28
Re: Setlevel command problem - by armyoftwo - 26.02.2011, 09:58
Re: Setlevel command problem - by Libra_PL - 26.02.2011, 10:04
Re: Setlevel command problem - by armyoftwo - 26.02.2011, 10:14

Forum Jump:


Users browsing this thread: 2 Guest(s)