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; }
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); } Код:
DMarea == 1; Код:
if (strcmp(cmdtext, "/leavedm", true)==0) { DMarea = 0; ResetPlayerWeapons(playerid); SpawnPlayer(playerid); return 1; } offtopic: lol u are using Stunt Evolution GM arent you? |
Set their health, armor and give their guns @ OnPlayerSpawn..
You don't want to teleport someone if they die ( OnPlayerDeath ) |