[SOLVED]/exit dm - 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: [SOLVED]/exit dm (
/showthread.php?tid=106855)
[SOLVED]/exit dm -
DarkClone - 06.11.2009
Hello, I've searched but couldn't find the right thing..I have DM zones and they disable the commands when players enter them, but there is no other way to leave them unless you die, Would there be a way to exit them ex: /exit allowing that command but the commands are disabled?
Re: /exit dm -
Pinehole - 06.11.2009
Use a command like this
Код:
if (strcmp("/exit", cmdtext, true, 10) == 0) {
//SETS THEIR POS SOMEWHERE, or where ever you want them to teleport back to. this is just an example.
SetPlayerPos(playerid,2352.0007,-1168.8942,27.9879);
SetPlayerInterior(playerid, 0);
return 1;
}
Re: /exit dm -
DarkClone - 06.11.2009
Quote:
Originally Posted by Pinny
Use a command like this
Код:
if (strcmp("/exit", cmdtext, true, 10) == 0) {
//SETS THEIR POS SOMEWHERE, or where ever you want them to teleport back to. this is just an example.
SetPlayerPos(playerid,2352.0007,-1168.8942,27.9879);
SetPlayerInterior(playerid, 0);
return 1;
}
|
That wont work, because the commands are disabled when they are in a /dm, How can i make it so if there in a dm zone "PlayerData[playerid][InDM] = 1;" they can only use /exit?
--edit: I figured it out, it had to be like this:
Код:
if(strcmp("/exit", cmdtext, true, 10) == 0)
{
if(PlayerData[playerid][InDM] == 1)
return 1;
{
TogglePlayerControllable(playerid,true);
SetCameraBehindPlayer(playerid);
SpawnPlayer(playerid);
PlayerData[playerid][InDM] = 0;
SendClientMessage(playerid,COLOR_YELLOW,"You have left the death match");
return 0;
}
}
thanks guys
Re: /exit dm -
RenisiL - 06.11.2009
here command exit dm
if (strcmp("/exit", cmdtext, true, 10) == 0) {
SetPlayerPos(playerid,2352.0007,-1168.8942,27.9879);
SetPlayerInterior(playerid, 0);
PlayerData[playerid][InDM] = 0;
return 1;
}