SA-MP Forums Archive
DM Area Help ! - 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)
+--- Thread: DM Area Help ! (/showthread.php?tid=377965)



DM Area Help ! - Beljulji - 16.09.2012

i tryied to add when i enter the dm area and someone kills me im automaticly spawned back there but the problem is when i exit DM and someone kill me outside it teleports me to DM area what i need to do so when someone kills me outside the dm i will be spawned at spawn point not in DM code
Код:
new dmevent[MAX_PLAYERS];

dmevent[playerid] = 1; i putted this on DM teleport command

//OnPlayerSpawn

if(dmevent[playerid] == 1)
{
	// code for callback
}
if(dmevent[playerid] == 1) on /exitdm command



Re: DM Area Help ! - JaKe Elite - 16.09.2012

When player leaves set the dmevent to 0
then OnPlayerSpawn if dmevent is 0 spawn him outside.


Re: DM Area Help ! - Beljulji - 16.09.2012

oh well i forgot about this i done that and it works but i added on other dm areas so if(dmevent[playerid] == 1)
and if(dmevent[playerid] == 2) until if(dmevent[playerid] == 7) and added on /exitdm if(dmevent[playerid] == 1) until if(dmevent[playerid] == 7) and if(dmevent[playerid] == 1) until if(dmevent[playerid] == 7) onplayerspawn and when i type /exitdm it teleports me back to spawnplace but when i use /kill onspawnplace it teleports me back to DM thats the problem


Re: DM Area Help ! - JaKe Elite - 16.09.2012

Well like i mention above.
Set dmevent to 0 when player uses /kill or some commands that make them spawn outside
Not sure. But check if player's variable dmevent is 1, 2 until it reach 7 when its in dmevent 1 to 7
then Set the dmevent to 1 to 7. then if player's variable dmevent is 0. then set the dmevent to 0.

Not sure untested.


Re: DM Area Help ! - Beljulji - 16.09.2012

well i done all that but no changes when ui type /exitdm it teleports me on spawnplace but when i die after i type /exitdm it teleports me back to the last DM area idk why? i added dmevent[playerid] = 0; in exitdm and onplayerspawn. and all other things where it should be