09.11.2009, 05:05
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:
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; }