DM zone - 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 zone (
/showthread.php?tid=104045)
DM zone -
martyz-lithuania - 22.10.2009
Hi. I decided to make new DM zone, but i don't know how to how to make if you in that zone only /exit command work.
This is teleport to DM zone:
Код:
if(!strcmp(cmdtext,"/cr-dm",true))
{
SetPlayerPos(playerid,561.9404, -3516.9241, 5.5000);
SendClientMessage(playerid, 0xFF000090, "*DM zona");
SetPlayerVirtualWorld(playerid, 2);
return 1;
}
Exit command:
Код:
if(!strcmp(cmdtext,"/exit",true))
{
SetPlayerPos(playerid, 397.5430, -1804.3560, 8.9000);
SendClientMessage(playerid, 0xFF000090, " Home");
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid,0);
return 1;
}
Please help me

Thanks
Re: DM zone -
Correlli - 22.10.2009
pawn Код:
new bool:myVariable[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
myVariable[playerid] = false; // reset the variable - you could do it at OnPlayerDisconnect-callback instead at OnPlayerConnect but it will reset it anyway.
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/cr-dm", true))
{
SetPlayerPos(playerid, 561.9404, -3516.9241, 5.5000);
SendClientMessage(playerid, 0xFF000090, "*DM zona");
SetPlayerVirtualWorld(playerid, 2);
myVariable[playerid] = true; // set it to true.
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/exit", true))
{
if(myVariable[playerid] == true) // is true?
{
SetPlayerPos(playerid, 397.5430, -1804.3560, 8.9000);
SendClientMessage(playerid, 0xFF000090, " Home");
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
myVariable[playerid] = false; // set it to fase.
}
else
{
// msg:_can't_use_this_command_if_you're_not_in_the_zone_.
}
return 1;
}
Or do you mean you can use ONLY /exit from all commands?
Re: DM zone -
martyz-lithuania - 22.10.2009
Thank you very much

Very very big respect
Re: DM zone -
Eulfen - 22.10.2009
Its easy to script that file
Anyway trusted scripters are around!