Setting playerpos - 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: Setting playerpos (
/showthread.php?tid=511131)
Setting playerpos -
saikumar - 04.05.2014
Hey All.
this is the DM script i am using:
pawn Код:
CMD:mgdm(playerid, params[])
{
if (InAFK[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You are Now in AFK/BRB Mode! Try /back to use this cmd!");
return 1;
}
else
{
InDM[playerid] = 1;
DmID[playerid] = 1;
InLobby[playerid] = 0;
SendClientMessage(playerid, -1, "{FFFF00}Welcome to Minigun DM !");
SetPlayerInterior(playerid, 14);
new rand = random(sizeof(RandomSpawnMGDM));
SetPlayerPos(playerid, RandomSpawnMGDM[rand][0], RandomSpawnMGDM[rand][1], RandomSpawnMGDM[rand][2]);
SetPlayerVirtualWorld(playerid, 32);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 38, 100000);
new str[56+MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "{9933FF}***%s (ID: %d) has joined Minigun DM. (/mgdm)!", name, playerid);
SendClientMessageToAll(-1, str);
}
return 1;
}
if player joins the dm and gets killed then he is spawning in spawn location.
but i want to know is there any way to spawn in the location where player accessed the command instead of server spawn location.
please help me.
thanks in advance
Re: Setting playerpos -
Avi Raj - 04.05.2014
Make a new variable.
InDM == 1 means he is in DM and InDM == 0 means that he isn't in DM.
Use it on OnPlayerSpawn.
Re: Setting playerpos -
PinEvil - 04.05.2014
Make a /leavedm command, And use it as a reference.
EX:
GetPlayerPos(playerid);
SetPlayerPos(playerid, X,Y,Z);
Re: Setting playerpos -
saikumar - 04.05.2014
Quote:
Originally Posted by Avi Raj
Make a new variable.
InDM == 1 means he is in DM and InDM == 0 means that he isn't in DM.
Use it on OnPlayerSpawn.
|
i want the player should spawn from where he typed the command when he dies in DM
Quote:
Originally Posted by PinEvil
Make a /leavedm command, And use it as a reference.
EX:
GetPlayerPos(playerid);
SetPlayerPos(playerid, X,Y,Z);
|
i already have /leavedm cmd but its not the problem...
i want the player should spawn from where he typed the command when he dies in DM
Re: Setting playerpos -
saikumar - 04.05.2014
please somebody help me