help me fix onplayerdeath
#1

Quote:

public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pHospitalCured] == 0)
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pFacingAngle]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else if(PlayerInfo[playerid][pHospitalCured] >= 1)
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83, 270, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
PlayerInfo[playerid][pHospitalized] = 0;
TogglePlayerSpectating(playerid, true);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pHospitalized] >= 0)
{
SetTimer("Hospitalized", 5000, false);
GameTextForPlayer(playerid, "~r~Being transfered to Las Venturas Hospital..", 9000, 4);
RemovePlayerFromVehicle(playerid);
}
return 1;
}
forward Hospitalized(playerid);
public Hospitalized(playerid)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 9);
SetPlayerCameraPos(playerid, 1583.90, 1847.44, 17.89);
SetPlayerCameraLookAt(playerid, 1606.14, 1825.32, 10.82);
GameTextForPlayer(playerid, "~r~The Doctor is curing you...~n~~b~You will be release soon.", 10000, 4);
SetTimer("HospitalRelease", 10000, false);
PlayerInfo[playerid][pHospitalized] = 1;
SavePlayerProfile(playerid);
return 1;
}

forward HospitalRelease(playerid);
public HospitalRelease(playerid)
{
PlayerInfo[playerid][pHospitalCured] = 1;
PlayerInfo[playerid][pHospitalized] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 50);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~Released and Healed", 5000, 4);
OnPlayerSpawn(playerid);
SendClientMessage(playerid, COLOR_WHITE, "{FFDD00}Las Venturas Hospital{FFFFFF}: You have been cured and released.");
return 1;
}

it doesn't make me spawn in hospital??
Reply
#2

Where's your SetPlayerPos(playerid, Coords);
Does not work without the SetPlayerPos

EDIT: Found it U_U i guess i missed it.
Reply
#3

pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pHospitalCured] == 0)
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pFacingAngle]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else if(PlayerInfo[playerid][pHospitalCured] >= 1)
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83);
SpawnPlayer(playerid);
PlayerInfo[playerid][pHospitalized] = 0;
TogglePlayerSpectating(playerid, true);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pHospitalized] >= 0)
{
SetTimer("Hospitalized", 5000, false);
GameTextForPlayer(playerid, "~r~Being transfered to Las Venturas Hospital..", 9000, 4);
RemovePlayerFromVehicle(playerid);
}
return 1;
}
forward Hospitalized(playerid);
public Hospitalized(playerid)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 9);
SetPlayerCameraPos(playerid, 1583.90, 1847.44, 17.89);
SetPlayerCameraLookAt(playerid, 1606.14, 1825.32, 10.82);
GameTextForPlayer(playerid, "~r~The Doctor is curing you...~n~~b~You will be release soon.", 10000, 4);
SetTimer("HospitalRelease", 10000, false);
PlayerInfo[playerid][pHospitalized] = 1;
SavePlayerProfile(playerid);
return 1;
}

forward HospitalRelease(playerid);
public HospitalRelease(playerid)
{
PlayerInfo[playerid][pHospitalCured] = 1;
PlayerInfo[playerid][pHospitalized] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 50);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~Released and Healed", 5000, 4);
OnPlayerSpawn(playerid);
SendClientMessage(playerid, COLOR_WHITE, "{FFDD00}Las Venturas Hospital{FFFFFF}: You have been cured and released.");
return 1;
}
Here you go sir hope this works not tested...

You Welcome.
Gr. Aveger
Reply
#4

Quote:
Originally Posted by Aveger
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pHospitalCured] == 0)
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pFacingAngle]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else if(PlayerInfo[playerid][pHospitalCured] >= 1)
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83);
SpawnPlayer(playerid);
PlayerInfo[playerid][pHospitalized] = 0;
TogglePlayerSpectating(playerid, true);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pHospitalized] >= 0)
{
SetTimer("Hospitalized", 5000, false);
GameTextForPlayer(playerid, "~r~Being transfered to Las Venturas Hospital..", 9000, 4);
RemovePlayerFromVehicle(playerid);
}
return 1;
}
forward Hospitalized(playerid);
public Hospitalized(playerid)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 9);
SetPlayerCameraPos(playerid, 1583.90, 1847.44, 17.89);
SetPlayerCameraLookAt(playerid, 1606.14, 1825.32, 10.82);
GameTextForPlayer(playerid, "~r~The Doctor is curing you...~n~~b~You will be release soon.", 10000, 4);
SetTimer("HospitalRelease", 10000, false);
PlayerInfo[playerid][pHospitalized] = 1;
SavePlayerProfile(playerid);
return 1;
}

forward HospitalRelease(playerid);
public HospitalRelease(playerid)
{
PlayerInfo[playerid][pHospitalCured] = 1;
PlayerInfo[playerid][pHospitalized] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 50);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~Released and Healed", 5000, 4);
OnPlayerSpawn(playerid);
SendClientMessage(playerid, COLOR_WHITE, "{FFDD00}Las Venturas Hospital{FFFFFF}: You have been cured and released.");
return 1;
}
Here you go sir hope this works not tested...

You Welcome.
Gr. Aveger
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\LVRP\gamemodes\lvrp.pwn(1060 ) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Warnings.

(in this line)
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83);

Reply
#5

SetSpawnInfo(playerid, team, skin, Float, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)

playerid The PlayerID of who you want to set the spawn information.
team The Team-ID of the chosen player.
skin The skin which the player will spawn with.
Float:X The X-coordinate of the player's spawn position.
Float:Y The Y-coordinate of the player's spawn position.
Float:Z The Z-coordinate of the player's spawn position.
Float:Angle The direction in which the player needs to be facing after spawning.
weapon1 The first spawn-weapon for the player.
weapon1_ammo The amount of ammunition for the primary spawnweapon.
weapon2 The second spawn-weapon for the player.
weapon2_ammo The amount of ammunition for the second spawnweapon.
weapon3 The third spawn-weapon for the player.
weapon3_ammo The amount of ammunition for the third spawnweapon.
Reply
#6

some one help me?
Reply
#7

post the original errors.
Reply
#8

Quote:

public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pHospitalCured] == 0)
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pFacingAngle]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else if(PlayerInfo[playerid][pHospitalCured] >= 1)
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83, 270, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
PlayerInfo[playerid][pHospitalized] = 0;
TogglePlayerSpectating(playerid, true);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pHospitalized] >= 0)
{
SetTimer("Hospitalized", 5000, false);
GameTextForPlayer(playerid, "~r~Being transfered to Las Venturas Hospital..", 9000, 4);
RemovePlayerFromVehicle(playerid);
}
return 1;
}
forward Hospitalized(playerid);
public Hospitalized(playerid)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 9);
SetPlayerCameraPos(playerid, 1583.90, 1847.44, 17.89);
SetPlayerCameraLookAt(playerid, 1606.14, 1825.32, 10.82);
GameTextForPlayer(playerid, "~r~The Doctor is curing you...~n~~b~You will be release soon.", 10000, 4);
SetTimer("HospitalRelease", 10000, false);
PlayerInfo[playerid][pHospitalized] = 1;
SavePlayerProfile(playerid);
return 1;
}

forward HospitalRelease(playerid);
public HospitalRelease(playerid)
{
PlayerInfo[playerid][pHospitalCured] = 1;
PlayerInfo[playerid][pHospitalized] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 50);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~Released and Healed", 5000, 4);
OnPlayerSpawn(playerid);
SendClientMessage(playerid, COLOR_WHITE, "{FFDD00}Las Venturas Hospital{FFFFFF}: You have been cured and released.");
return 1;
}

it doesn't make me spawn in hospital??
Reply
#9

pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pHospitalCured] == 0)
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pFacingAngle]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else if(PlayerInfo[playerid][pHospitalCured] >= 1)
{
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83, 270, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
PlayerInfo[playerid][pHospitalized] = 0;
TogglePlayerSpectating(playerid, true);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pHospitalized] >= 0)
{
SetTimer("Hospitalized", 5000, false);
GameTextForPlayer(playerid, "~r~Being transfered to Las Venturas Hospital..", 9000, 4);
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
}
return 1;
}
forward Hospitalized(playerid);
public Hospitalized(playerid)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 9);
SetPlayerCameraPos(playerid, 1583.90, 1847.44, 17.89);
SetPlayerCameraLookAt(playerid, 1606.14, 1825.32, 10.82);
GameTextForPlayer(playerid, "~r~The Doctor is curing you...~n~~b~You will be release soon.", 10000, 4);
SetTimer("HospitalRelease", 10000, false);
PlayerInfo[playerid][pHospitalized] = 1;
SavePlayerProfile(playerid);
return 1;
}

forward HospitalRelease(playerid);
public HospitalRelease(playerid)
{
PlayerInfo[playerid][pHospitalCured] = 1;
PlayerInfo[playerid][pHospitalized] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 50);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~Released and Healed", 5000, 4);
OnPlayerSpawn(playerid);
SendClientMessage(playerid, COLOR_WHITE, "{FFDD00}Las Venturas Hospital{FFFFFF}: You have been cured and released.");
return 1;
}
THIS MIGHT!!!WORK!!!
Not Tested.
Also You confuse yourself here might as well define the coords like
pawn Код:
#define hospitalspawn coords
I Don't this this will work but you can try it...

EDITED: Found a mistake after posted it U_U
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)