Death Timer At Hospital - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Death Timer At Hospital (
/showthread.php?tid=73218)
Death Timer At Hospital -
Alec24 - 13.04.2009
When you die you should wait until your health recharges at the hospoital. (Done using a timer), But it just seems to spawn me after 1 second.
pawn Код:
public Death(playerid)
{
new Float:H = GetPlayerHealth(playerid,H);
if (H < 100)
{
SetPlayerHealth(playerid,(H+5));
return 1;
}else{
SetPlayerPos(playerid,-314.1351,1056.9514,19.7422);
SetPlayerFacingAngle(playerid,357.2336);
SetCameraBehindPlayer(playerid);
GameTextForPlayer(playerid, "~w~You Have Been ~b~Healed!", 5000, 3);
}
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new name[24], string[64];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "%s Has Died!", name);
SendClientMessageToAll(COLOUR_LIGHTRED, string);
Drugs[playerid] = 0;
//------------------------------------------------------------------------------
new HospBill;
new dstr[128];
HospBill = (random(2000))+1000;
GivePlayerMoney(playerid,-HospBill);
format(dstr, sizeof(dstr), "~w~Hospital Bill: ~r~$%s~n~~n~~r~Being Healed~n~~n~~n~~b~Please Wait", HospBill);
GameTextForPlayer(playerid, dstr, 15000, 3);
SetPlayerCameraPos(playerid, -285.2971, 1054.9896, 27.5900);
SetPlayerCameraLookAt(playerid, -294.2486, 1050.8154, 26.0256);
SetPlayerPos(playerid,-321.853,1042.690,19.401);
TogglePlayerControllable(playerid,0);
SetTimer("Death",1000,true);
return 1;
}
Re: Death Timer At Hospital -
Alec24 - 13.04.2009
I really need help with this Thanks.
Re: Death Timer At Hospital -
Lewwy - 13.04.2009
https://sampwiki.blast.hk/wiki/SetTimerEx
Re: Death Timer At Hospital -
Alec24 - 13.04.2009
Thanks for the reply but that wiki page is very hard to understand and I dont get what SetTimerEx is even doing. Can someone please help me with the SetTimerEx.
Re: Death Timer At Hospital -
Lewwy - 13.04.2009
SetTimerEx is for a specific player, your SetTimer will only work for playerid 0.
Re: Death Timer At Hospital -
ICECOLDKILLAK8 - 13.04.2009
SetTimerEx is to pass parameters to a timed function
SetTimerEx(Function, Time, Repeating, FormatOfWhatToSend, WhatToSend)
playerid is an integer (number) so for FormatOfWhatToSend you would put i or d, Then in what to send you would put playerid