Need Little Help Only! - 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: Need Little Help Only! (
/showthread.php?tid=305944)
Need Little Help Only! -
James Coral - 24.12.2011
Hey all i made /mdm1 Command (MINIGUN DEATH MATCH)
But how do make leaveing command
?
i have this code:
Код:
if(strcmp("/mdm1", cmdtext, true, 10) == 0)
{
if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You cant use any command While Your in DM");
else
{
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s has teleported to {FFFFFF}Minigun Area - Xtreme Stunting Minigun Area (BETA) (/mdm1)",pName);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_GREEN,"Welcome To Minigun Area");
GameTextForPlayer(playerid,"~w~Welcome To ~r~Minigun ~g~Area ~y~4",3000,3);
if (IsPlayerInAnyVehicle(playerid)) {
SetVehiclePos(GetPlayerVehicleID(playerid),2306.8291,1406.1932,42.4696);
SetVehicleZAngle(GetPlayerVehicleID(playerid),268);
} else {
SetPlayerPos(playerid,200.0273,1388.7929,42.6139);
SetPlayerFacingAngle(playerid,118);
GivePlayerWeapon(playerid, 38, 99999999);
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
SetPlayerInterior(playerid,0);
}
}
return 1;
}
Re: Need Little Help Only! -
James Coral - 24.12.2011
Please HELP ME SOMEONE!!!!!!!!!!!!!!!!!!!!!!!
Re: Need Little Help Only! -
Rob_Maate - 24.12.2011
Wow. Just do the inverse to what you've done here.
Save the user's previous position like so:
pawn Код:
new Float:PrePos[MAX_PLAYERS][3];
GetPlayerPos(playerid, PrePos[playerid][0], PrePos[playerid][1], PrePos[playerid][2]);
And then afterwards, spawn him back without his minigun
pawn Код:
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, PrePos[playerid][0], PrePos[playerid][1], PrePos[playerid][2]);