Setting playerpos
#1

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
Reply
#2

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.
Reply
#3

Make a /leavedm command, And use it as a reference.

EX:
GetPlayerPos(playerid);
SetPlayerPos(playerid, X,Y,Z);
Reply
#4

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
Reply
#5

please somebody help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)