Code error, expected token "," -
Malicious - 06.09.2014
I have been working on a faction spawn system and I've come across an error that I can't seem to understand, I might just be missing the most obvious thing but I need some assistance to be on the safe side.
The error occurs on line 3281 [labelled in the code], help would be appreciated.
Код:
(3281) : error 001: expected token: ",", but found "["
(3281) : error 029: invalid expression, assumed zero
(3281) : warning 215: expression has no effect
(3281) : error 001: expected token: ";", but found "]"
(3281) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
command(setfactionspawn, playerid, params[])
{
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, GREY, "Usage: /setspawnpoint {5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} 1-3");
{
if(id > 5) return SendClientMessage(playerid, GREY, "[ Faction Spawn ] Choose 1-3");
if(id < 1) return SendClientMessage(playerid, GREY, "[ Faction Spawn ] Choose 1-3");
if(id == 1)
{
---> SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnSet][1][fSpawnPosX], Factions[Player[playerid][Faction]][fSpawnSet][1][fSpawnPosY], Factions[Player[playerid][Faction]][fSpawnSet][1][fSpawnPosZ], 90.0, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GREY, "{5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} you have sucessfully created faction spawn 1! ");
}
else if(id == 2)
{
SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnSet][2][fSpawnPosX], Factions[Player[playerid][Faction]][fSpawnSet][2][fSpawnPosY], Factions[Player[playerid][Faction]][fSpawnSet][2][fSpawnPosZ], 90.0, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GREY, "{5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} you have sucessfully created faction spawn 2! ");
}
else if(id == 3)
{
SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnSet][3][fSpawnPosX], Factions[Player[playerid][Faction]][fSpawnSet][3][fSpawnPosY], Factions[Player[playerid][Faction]][fSpawnSet][3][fSpawnPosZ], 90.0, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GREY, "{5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} you have sucessfully created faction spawn 3! ");
}
else return SendClientMessage(playerid, GREY, "{5148F2}[ {FFFFFF}Spawn{5148F2} ] {FFFFFF} n/a");
}
return 1;
}
Re: Expected token / expression has no effect -
Malicious - 06.09.2014
... everything else I try doesn't even work, it compiles but it wont work in game. Any advice?
Re: Expected token / expression has no effect -
DaTa[X] - 06.09.2014
pawn Код:
command(setfactionspawn, playerid, params[])
{
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, GREY, "Usage: /setspawnpoint {5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} 1-3")
{
if(id > 5) return SendClientMessage(playerid, GREY, "[ Faction Spawn ] Choose 1-3");
if(id < 1) return SendClientMessage(playerid, GREY, "[ Faction Spawn ] Choose 1-3");
if(id == 1)
{
SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnSet][1] [fSpawnPosX], Factions[Player[playerid][Faction]][fSpawnSet][1][fSpawnPosY], Factions[Player[playerid][Faction]][fSpawnSet][1][fSpawnPosZ], 90.0, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GREY, "{5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} you have sucessfully created faction spawn 1! ");
}
else if(id == 2)
{
SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnSet][2][fSpawnPosX], Factions[Player[playerid][Faction]][fSpawnSet][2][fSpawnPosY], Factions[Player[playerid][Faction]][fSpawnSet][2][fSpawnPosZ], 90.0, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GREY, "{5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} you have sucessfully created faction spawn 2! ");
}
else if(id == 3)
{
SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnSet][3][fSpawnPosX], Factions[Player[playerid][Faction]][fSpawnSet][3][fSpawnPosY], Factions[Player[playerid][Faction]][fSpawnSet][3][fSpawnPosZ], 90.0, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GREY, "{5148F2}[ {FFFFFF}Faction Spawns{5148F2} ] {FFFFFF} you have sucessfully created faction spawn 3! ");
}
else return SendClientMessage(playerid, GREY, "{5148F2}[ {FFFFFF}Spawn{5148F2} ] {FFFFFF} n/a");
}
return 1;
}