[Solved] id 0 issue
#1

im having an issue with trying to spawn at my deathpoint. it works fine and correctly but its going to id 0s spawn point. how can i fix this to where it to spawn to my own position?

Here is my Code:

Код:
#include <a_samp>

#define deathpoint1 (324)

new IsPlayerDead[MAX_PLAYERS];
new Float:xpos1, Float:ypos1, Float:zpos1;
new Float:Anglepos1;
new mycarid;
new Float:vzrot;

public OnPlayerDeath(playerid, killerid, reason)
{
	IsPlayerDead[playerid]=1;
	if(IsPlayerDead[playerid]==1)
	{
	GetPlayerFacingAngle(playerid, Anglepos1);
	GetPlayerPos(playerid,xpos1,ypos1,zpos1);
	mycarid=GetPlayerVehicleID(playerid);
	GetVehiclePos(playerid,xpos1,ypos1,zpos1);
	GetVehicleZAngle(mycarid, vzrot);
 	return 1;
  }
  	return 1;
  }
  
public OnPlayerSpawn(playerid)
{
  	if(IsPlayerDead[playerid]==1)
	{
	ShowPlayerDialog(playerid, deathpoint1, DIALOG_STYLE_MSGBOX, "Question", "Do you want to Spawn back to where you died?", "yes", "no");
	}
	return 1;
  }
  
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  	if (dialogid == deathpoint1)
  {
    if (response == 1)
    {
    if(IsPlayerDead[playerid]==1)
		{
		SetPlayerFacingAngle( playerid, Anglepos1);
 		SetPlayerPos(playerid, xpos1, ypos1, zpos1);
 		SetVehiclePos(mycarid,xpos1,ypos1,zpos1);
  		SetVehicleZAngle(mycarid, vzrot);
  		PutPlayerInVehicle(playerid, mycarid, 0);
  		SendClientMessage(playerid, 0xFFFFFFFF, "You have Teleported Where You Died");
    }}
    else
    {
		SendClientMessage(playerid, 0xFFFFFFFF, "You Cancelled");
    }
    return 1;
  }
  return 1;
}
Reply


Messages In This Thread
[Solved] id 0 issue - by troy52192 - 09.11.2009, 05:05
Re: id 0 issue - by MenaceX^ - 09.11.2009, 05:27
Re: id 0 issue - by troy52192 - 09.11.2009, 13:57
Re: id 0 issue - by MenaceX^ - 09.11.2009, 14:14
Re: id 0 issue - by troy52192 - 09.11.2009, 14:23
Re: id 0 issue - by troy52192 - 09.11.2009, 14:34
Re: id 0 issue - by Daren_Jacobson - 09.11.2009, 19:12
Re: id 0 issue - by retart441 - 09.11.2009, 19:46
Re: id 0 issue - by Djiango - 09.11.2009, 20:48

Forum Jump:


Users browsing this thread: 3 Guest(s)