SetPlayerPos wont set my position +rep
#1

Okay, so I have a death system, pretty basic


and no errors or warning, I have made the pDead a new thing, it gives me the client messages and - the cash, but it doesnt set my position, it sets it to the field in blueberry

code(under on playerspawn:
Код:
    if(pDead[playerid] == 1)
	{
	if(PlayerInfo[playerid][pInsurance] == 1)
	{
    SetPlayerPos(playerid, 1179.0568,-1324.3087,14.1506);
    SCM(playerid, COLOR_LIGHTRED, "It seem's you passed out and ended up at the hospital!");
    SCM(playerid, COLOR_LIGHTRED, "You have lost 30 minutes of your memory! ");
    SCM(playerid, COLOR_LIGHTRED, "You were charged $750 for your medical and hospital fees.");
    SetPlayerHealth(playerid, 100);
    GivePlayerCash(playerid, -750);
    pDead[playerid] = 0;
  	}
 	if(PlayerInfo[playerid][pInsurance] == 0)
	{
    SetPlayerPos(playerid, 1179.0568,-1324.3087,14.1506);
    SCM(playerid, COLOR_LIGHTRED, "It seem's you passed out and ended up at the hospital!");
    SCM(playerid, COLOR_LIGHTRED, "You have lost 30 minutes of your memory! ");
    SCM(playerid, COLOR_LIGHTRED, "You were charged $2000 for your medical and hospital fees.");
    SCM(playerid, COLOR_YELLOW, "NOTE: You can buy insurance outside the hospital for $2500!");
    GivePlayerCash(playerid, -2000);
    SetPlayerHealth(playerid, 50);
    pDead[playerid] = 0;
  	}
+rep to anyone that can help

Also, +rep if anyone can help me out on this thread: click here
Reply
#2

try doing this:

pawn Код:
forward HosPos(playerid); //At the top of the script.

SetTimerEx("HosPos", 2000, 0, "i", playerid); // Under OnPlayerSpawn.

public HosPos(playerid)
{
    SetPlayerPos(playerid, 1179.0568, -1324.3087, 14.1506);
    return 1;
}//This public anywhere under OnPlayerSpawn.
Thanks.
Reply
#3

It gets errors when compiling


C:\Users\Matty\Desktop\SAMP Scripting - Copy\gamemodes\rp.pwn(1584) : warning 211: possibly unintended assignment
C:\Users\Matty\Desktop\SAMP Scripting - Copy\gamemodes\rp.pwn(168 : error 029: invalid expression, assumed zero
C:\Users\Matty\Desktop\SAMP Scripting - Copy\gamemodes\rp.pwn(168 : error 017: undefined symbol "HosPos"
C:\Users\Matty\Desktop\SAMP Scripting - Copy\gamemodes\rp.pwn(1693) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

Check your OnGameModeInit() in your gamemode file, factors that can affect this are functions such as: AddPlayerClass, SetSpawnInfo, SpawnPlayer and SetPlayerPos.
Reply
#5

Maybe you need to set virtual world

just put it before setpos
Код:
SetPlayerVirtualWorld(playerid, 0);
Reply
#6

Is that a joke?
Reply
#7

Are you a joke ?
Reply
#8

How, in any way does a player's virtual world affect their position being set. I can understand if you were talking about interiors, but there is no connection between Virtual Worlds and actual positions...
Reply
#9

What if he above this has func that sets player virtual world to something != 0 ?
Reply
#10

the virtual world has nothing to do with it, since it's not in an interior
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)