Help with SetPlayerPos
#1

Guys, when a player spawns, it sets their pos, but if they die, it dont set there death pos (Hospital) it just reset them to the spawn pos.

Why does this not set the players pos when they die (same as question one) and it dont even send the message to all.

pawn Код:
if(GetPlayerWantedLevel(playerid) == 2 && IsLaw[killerid] == 1)
    {
      new Str[256];
      new Kname[256];
      new PName[256];
      new rand = random(sizeof(JailCellSpawns));
      GetPlayerName(killerid,Kname,sizeof(Kname));
      GetPlayerName(playerid,PName,sizeof(PName));
      format(Str,66,"* %s has been jailed by %s.(2 mins)", PName, Kname);
      SendClientMessage(playerid,red,"You have been jailed for 2 mins.");
      SetPlayerPos(playerid, JailCellSpawns[rand][0], JailCellSpawns[rand][1], JailCellSpawns[rand][2]);
      SendClientMessageToAll(red,Str);
      jail[playerid] = 1;
      tjail[playerid] = SetTimerEx("Unjail",120000,false,"i",playerid);
      }
Reply
#2

pawn Код:
new rand = random(3);
Not the format(....)
Reply
#3

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
pawn Код:
new rand = random(3);
Not the format(....)
Yeah i had that, i just forgot to post it.

Btw, when i die, it puts me in jail for 1 sec then kill the player ( you know like when the screen moves left and right) then it sets me to spawn pos.
Reply
#4

You have no SetPlayerPos(playerid....); for at the hospital, just the jail.
Reply
#5

I have it OnPlayerDeath, at the top.
Reply
#6

Sorry to double post i found my prob for the hospital spawn But not for the Jail spawns.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)