SA-MP Forums Archive
Setting Spawn From PlayerInfo. - 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: Setting Spawn From PlayerInfo. (/showthread.php?tid=295599)



Setting Spawn From PlayerInfo. - DaRkAnGeL[NBK] - 06.11.2011

Hey,

I understand how this would be done:
pawn Код:
if(PlayerInfo[playerid][pFirstSpawn] = 1)
    {
        SetPlayerPos(playerid(PlayerInfo[playerid][pSpawn]));
    }
Could someone explain please? these are the errors:
Код:
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\LSRP.pwn(156) : warning 211: possibly unintended assignment
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\LSRP.pwn(158) : error 012: invalid function call, not a valid address
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\LSRP.pwn(158) : warning 215: expression has no effect
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\LSRP.pwn(158) : error 001: expected token: ";", but found ")"
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\LSRP.pwn(158) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\LSRP.pwn(158) : fatal error 107: too many error messages on one line

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


4 Errors.



Re: Setting Spawn From PlayerInfo. - Sascha - 06.11.2011

you need 4 parameters for the SetPlayerPos function
playerid, X Coord, Y Coord, Z Coord

So you need either an array with 3 fields, or just 3 variables which are storing the x, y and z coord

and it's like "playerid, x, y, z" and now "player(x, y, z)"


Re: Setting Spawn From PlayerInfo. - Xyrex - 06.11.2011

And also:
pawn Код:
if(PlayerInfo[playerid][pFirstSpawn] == 1)