What does this error mean?
#1

error 001: expected token: "*then", but found "-identifier-" ??


I cant get past this, Im trying o make a checkpoint with SetplayerCheckpoint its that line wich is messing up.

Line looks like this,

Код:
SetPlayerCheckpoint(i,posX,posY,posZ,5.0);
Ive tried it with { infront at the line above and having the } at the wery back aswell as putting it like { on a single own row and the last } on an own line. Still get this same error on that line. also tried it without the { } but still get the same problem.
Reply
#2

pawn Код:
SetPlayerCheckpoint(playerid,posX,posY,posZ,5.0);
Reply
#3

Forgot to mention i want it to be created for a whole team so its

Код:
{
GetPlayerPos(playerid,posX,posY,posZ);
for(new i=0; i<MAX_PLAYERS; i++)
if i == GetTeamByName ("Lambo")
SetPlayerCheckpoint(i,posX,posY,posZ,5.0);
SendTeamMessage(Team1, COLOR_RED, "Lambo Team Gather!");
return 1;
}
If i make it

Код:
{
GetPlayerPos(playerid,posX,posY,posZ);
for(new i=0; i<MAX_PLAYERS; i++)
if i == GetTeamByName ("Lambo")
SetPlayerCheckpoint(playerid,posX,posY,posZ,5.0);
SendTeamMessage(Team1, COLOR_RED, "Lambo Team Gather!");
return 1;
}
Wont that only set a wp for that specific player and not the whole team?
Reply
#4

pawn Код:
{
 GetPlayerPos(playerid,posX,posY,posZ);
 for ( new i = 0; i < MAX_PLAYERS; i++ ) {
 if ( i == GetTeamByName ("Lambo") ) {
 SetPlayerCheckpoint(i,posX,posY,posZ,5.0);
 SendTeamMessage(Team1, COLOR_RED, "Lambo Team Gather!");
 }
return 1;
}
There you go it should work

EDIT: oops thats wrong proper code is:

pawn Код:
{
 GetPlayerPos(playerid,posX,posY,posZ);
 new Team[MAX_PLAYERS] = GetTeamByName ("Lambo");
 for ( new i = 0; i < MAX_PLAYERS; i++ ) {
 if ( Team[i] == 5 ) {
 SetPlayerCheckpoint(i,posX,posY,posZ,5.0);
 SendTeamMessage(Team1, COLOR_RED, "Lambo Team Gather!");
 }
 }
 return 1;
}
Reply
#5

What's this supposed to do?

Код:
if i == GetTeamByName ("Lambo")
Any loose brackets, maybe?
Reply
#6

Quote:
Originally Posted by Vince
What's this supposed to do?

Код:
if i == GetTeamByName ("Lambo")
Any loose brackets, maybe?
lol it should be:

Код:
i = GetTeamByName ("Lambo") 
if ( i == the team id here E.G: 5 ) {
Reply
#7

Dont get those to work, get major error on the rest of the script, when using that.
Reply
#8

Anyone else know what the error means or ever come across it?
Reply
#9

Anyone?, Im sure somone has come across it, I cant be the only one.
Reply
#10

Well most people know how to script

if its that bad why dont you remove the code and rewrite it :P
with working code

maybe use https://sampwiki.blast.hk/wiki/Main_Page
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)