DM Help respawning.. - 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: DM Help respawning.. (
/showthread.php?tid=169783)
DM Help respawning.. -
Kevin_Joshen - 20.08.2010
Hey guys!
Im having a problem making players respawn in the minigun dm with full health and armor….
Here is my code for on player death.
Please help!!
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInRangeOfPoint(playerid, 200,-1042.5601,1061.8961,1346.0946))
{
new rand = random(sizeof(MDM));
SetPlayerPos(playerid,MDM[rand][PlayerX],MDM[rand][PlayerY],MDM[rand][PlayerZ]);
SetPlayerInterior(playerid,10);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,38,9999999);
GivePlayerMoney(playerid,-50000);
GivePlayerMoney(killerid,50000);
SendClientMessage(playerid,COLOR_RACE,"You have been respawned at the DM! Type a different tele to exit!");
}
else
{
SetTimerEx("LoadWeaponsToFile",250,false,"i",playerid);
SendDeathMessage(killerid,playerid,reason);
GivePlayerMoney(playerid,-20000);
GivePlayerMoney(killerid,15000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
SetPlayerScore(playerid,GetPlayerScore(playerid)+-1);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld (playerid,0);
GameTextForPlayer(playerid,"Y~y~O~b~U ~g~A~y~R~w~E ~r~P~b~W~g~N~y~T!!!",4000,3);
}
return 1;
}
it sets the player in the right place... but since the player died... he dies where it set him... I need it to respawn him there.
Re: DM Help respawning.. -
[MNC]Azz - 20.08.2010
Heres a better way....
Код:
new DMarea;
public OnPlayerSpawn(playerid)
{
if (DMarea == 1)
{
new rand = random(sizeof(MDM));
SetPlayerPos(playerid,MDM[rand][PlayerX],MDM[rand][PlayerY],MDM[rand][PlayerZ]);
SetPlayerInterior(playerid,0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,38,9999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
also add this into your teleport command
and you might also want to make a /leavedm or sumthin command
Код:
if (strcmp(cmdtext, "/leavedm", true)==0)
{
DMarea = 0;
ResetPlayerWeapons(playerid);
SpawnPlayer(playerid);
return 1;
}
hope it helped...
offtopic:
lol u are using Stunt Evolution GM arent you?
Re: DM Help respawning.. -
Kevin_Joshen - 20.08.2010
For some reason... when i implement this... it undefines my function "CreateHouse"
EX.
when i dont have what you gave me in my script... i get no errors or warnings.....
when i put what you gave me in.. i get "Undefined Symbol: CreateHouse" even though it is.
Off topic:
Yes i am using that as my base mode.. but I changed almost every variable of it and added over 14 thousand lines to it. You can't even begin to tell that it is from that GM. How'd you know?
Re: DM Help respawning.. -
Kevin_Joshen - 21.08.2010
(deleted--remembered edit button
)
Re: DM Help respawning.. -
Kevin_Joshen - 23.08.2010
bump
(not enough characters... so im just adding in this text...
)
Re: DM Help respawning.. -
Kevin_Joshen - 23.08.2010
come on guys! that makes 2 bumps this week!