SetPlayerCheckpoint problem
#1

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.
Reply
#2

Compiles fine as it is..
Reply
#3

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;
}
Reply
#4

Which line is giving you errors?
Reply
#5

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);
    }
Reply
#6

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.
Reply
#7

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
Reply
#8

Problem solved thanks.
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)