3 errors in command
#1

Hello i need help with this errors can you help please :

All errors are in the same line

Quote:

(5075) : error 017: undefined symbol "player_zone"
(5075) : warning 215: expression has no effect
(5075) : error 001: expected token: ";", but found "]"
(5075) : error 029: invalid expression, assumed zero
(5075) : fatal error 107: too many error messages on one line

Quote:

COMMAND:loc(playerid, params[])
{
SendAdminText(playerid, "/loc", params);

new id;
new target, current_zone;
current_zone = player_zone[target]; // error Line
if(sscanf(params, "u", id))
{
SendClientMessage(playerid, 0xFF0000FF, "Usage: /loc [playerid]");
}
else
{
if(current_zone != -1 && IsPlayerConnected(target))
{
new playername[MAX_PLAYER_NAME],message2[170];
GetPlayerName(id,playername,MAX_PLAYER_NAME);
format(message2,sizeof(message2),"%s(%d)'s current location: %s",playername,target,zones[current_zone][zone_name]);
SendClientMessage(playerid,0x00C7FFAA,message2);
}
else
{
SendClientMessage(playerid,red,"Invalid Player ID");
}
}
}

Reply
#2

Quote:

error 017: undefined symbol "player_zone"

You haven't defined it.
Reply
#3

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
You haven't defined it.
Quote:

current_zone = player_zone

is this not ?
Reply
#4

you have ?
PHP код:
new player_zone[MAX_PLAYERS]; 
Reply
#5

No, use new to declare it.
You see you declare current_zone:
Код:
new target, current_zone;
current_zone = player_zone[target];
But not player_zone.

I don't understand what you're trying to do with "target" either, you're just declaring a variable which will be 0.
Shouldn't you use id or playerid?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)