SA-MP Forums Archive
SetPlayerCheckpoint problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetPlayerCheckpoint problem (/showthread.php?tid=373124)



SetPlayerCheckpoint problem - GTAprogamer111 - 29.08.2012

Well I don't know whats wrong:
pawn Код:
#define TerroristCP 2216.9297,-1147.5685,1025.7969

public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,15);
   
    if (GetPlayerSkin(playerid) == 29)
    {
        SetPlayerCheckpoint(playerid, TerroristCP, 3.0);
    }
    return 1;
}
Errors
Код:
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(152) : error 017: undefined symbol "TerroristCP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: SetPlayerCheckpoint problem - C00K13M0N$73R - 29.08.2012

Compiles fine as it is..


Re: SetPlayerCheckpoint problem - HuSs3n - 29.08.2012

maybe like this
pawn Код:
new TerroristCP[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,15);
   
    if (GetPlayerSkin(playerid) == 29)
    {
        TerroristCP[playerid]=SetPlayerCheckpoint(playerid,  2216.9297,-1147.5685,1025.7969, 3.0);
    }
    return 1;
}



Re: SetPlayerCheckpoint problem - clarencecuzz - 29.08.2012

Which line is giving you errors?


Re: SetPlayerCheckpoint problem - GTAprogamer111 - 29.08.2012

If so then
Quote:

C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(159) : error 017: undefined symbol "TerroristCP"
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(159) : warning 215: expression has no effect
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(159) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(159) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(159) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Quote:

Which line is giving you errors?

I'm sure this:
pawn Код:
if (GetPlayerSkin(playerid) == 29)
    {
        SetPlayerCheckpoint(playerid, TerroristCP, 3.0);
    }



Re: SetPlayerCheckpoint problem - clarencecuzz - 29.08.2012

Make sure your #define TerroristCP is at the top of the script, it has to be above the SetPlayerCheckpoint line, or before you use it in any circumstances.

Place it directly under your includes.


Re: SetPlayerCheckpoint problem - HuSs3n - 29.08.2012

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,15);
   
    if (GetPlayerSkin(playerid) == 29)
    {
        SetPlayerCheckpoint(playerid,  2216.9297,-1147.5685,1025.7969, 3.0);
    }
    return 1;
}
you can do it without a variable since you cant add more than one cp at one time


Re: SetPlayerCheckpoint problem - GTAprogamer111 - 29.08.2012

Problem solved thanks.


Re: SetPlayerCheckpoint problem - Kevin FOx - 29.08.2012

pawn Код:
if (GetPlayerSkin(playerid) == 29)
    {
        SetPlayerCheckpoint(playerid, TerroristCP, 3.0);
    }
pawn Код:
Since this is the TerroristCP = 2216.9297,-1147.5685,1025.7969 then remove TerroristCP from the SetPlayerCheckPoint and put the X Y Z, and add another ) after that one on GetPlayerSkin
Try this one..
pawn Код:
if (GetPlayerSkin(playerid) == 29))
    {
        SetPlayerCheckpoint(playerid,2216.9297,-1147.5685,1025.7969,3);
    }
Wish it to work.



EDIT: Late, didnt see that it was solved.