Problem with /goto command
#1

Hey there. I have a little problem with this command

Код:
dcmd_goto(playerid, id[])
{
	new pname[MAX_PLAYER_NAME], file[256], string[256], alvl[256];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(file, sizeof(string), "\\Users\\%s.ini", pname);
	if(!logged[playerid]) SendClientMessage(playerid, COLOR_RED, "You are not logged in!");
	if(IsPlayerConnected(id))
	{
		alvl = dini_Get(file, "level");
		switch(alvl)
		{
		  case(1):
		  {
	  		SendClientMessage(playerid, COLOR_RED, "You have teleported to the ID");
				SetPlayerPos(playerid, id);
			}
			default:
			{
			  SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
			}
			return 1;
		}
	}
	else SendClientMessage(playerid, COLOR_RED, "That player is not connected!");
	return 1;
}
I added this on top

Код:
new id[MAX_PLAYERS];
And I get these errors

Код:
gamemodes\registerorlogin.pwn(155) : warning 219: local variable "id" shadows a variable at a preceding level
gamemodes\registerorlogin.pwn(161) : error 035: argument type mismatch (argument 1)
gamemodes\registerorlogin.pwn(164) : error 033: array must be indexed (variable "-unknown-")
gamemodes\registerorlogin.pwn(169) : error 035: argument type mismatch (argument 2)
gamemodes\registerorlogin.pwn(175) : error 002: only a single statement (or expression) can follow each "case"
gamemodes\registerorlogin.pwn(175) : warning 215: expression has no effect
gamemodes\registerorlogin.pwn(157) : warning 204: symbol is assigned a value that is never used: "string"
gamemodes\registerorlogin.pwn(157 -- 178) : error 010: invalid function or declaration
gamemodes\registerorlogin.pwn(157 -- 179) : error 010: invalid function or declaration
gamemodes\registerorlogin.pwn(157 -- 179) : fatal error 107: too many error messages on one line
Could you help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)