29.07.2011, 03:05
i made a teleport called /chill and when u wanna leave you type /exitchill, now i wanna make it so when you type /exitchill it takes you back to the where you were before you typed /chill and it gives you back your weapons
Heres the code for /chill
And Heres the code for /exitchill
Heres the code for /chill
pawn Код:
if (strcmp(cmdtext, "/chill", true) == 0)//code credits: Sideways
{
if(InDm[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED,"Error: You cannot use this command in a DM! You must /leavedm first.");
return 1;
}
SetPlayerInterior(playerid,5);
SetPlayerPos(playerid,1270.38,-787.42,1084.01);
ResetPlayerWeapons(playerid);//Takes weapons
SetPlayerHealth(playerid, 100000);
SendClientMessage(playerid, blue, "{FFFFFF}Welcome to the chill zone");
SendClientMessage(playerid, blue, "{FFFFFF}We have taken your weapons away because there is{FF0000} NO KILLING{FFFFFF} in the chill zone");
SendClientMessage(playerid, blue, "{FFFFFF}To exit the chill zone type{00FF00} /exitchill");
InChill[playerid] = 1;
return 1;
}
pawn Код:
if (strcmp(cmdtext, "/exitchill", true) == 0) //code credits: Sideways
{
if(InChill[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED,"Error: You are not in Chill.");
return 1;
}
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2153.87,935.24,10.82);
GivePlayerWeapon(playerid, 22, 500);//gives the player a 9mm with 500 rounds of ammo
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, blue, "{FFFFFF}Welcome to the DM zone");
SendClientMessage(playerid, blue, "{FF0000}Your weapons were not given back");
InChill[playerid] = 0;
return 1;
}