Proplem with player pos
#4

Just check whether this works
pawn Код:
new InDM[MAX_PLAYERS];
new Dead[MAX_PLAYERS];
new DmID[MAX_PLAYERS];

new Float:dmx[MAX_PLAYERS], Float:dmy[MAX_PLAYERS], Float:dmz[MAX_PLAYERS];

CMD:mgdm(playerid, params[])
{
    InDM[playerid] = 1;
    DmID[playerid] = 1;
    InLobby[playerid] = 0;

    GetPlayerPos(playerid, dmx[playerid], dmy[playerid], dmz[playerid]);
    SetTimerEx("DMTimer",100,true,"u",playerid);
    return 1;
}

forward DMTimer(playerid);
public DMTimer(playerid)
{
    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);
}


public OnPlayerDeath(playerid, killerid, reason)
{

    SendDeathMessage(killerid, playerid, reason); // Shows the kill in the killfeed


    if(InDM[playerid] == 1)
    {
       if(killerid != INVALID_PLAYER_ID)
       {
       GivePlayerMoney(killerid, 5000);
       SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
       SendClientMessage(killerid, -1, "You have been awarded $5000 & +1 Score for killing your opponent in DM.");
       InDM[playerid] = 1;
       InLobby[playerid] = 1;
       Dead[playerid] = 1;
       return 1;
       }
    }
}
public OnPlayerSpawn(playerid)
{
    if(Dead[playerid] == 1 && InDM[playerid] == 1)
    {
        SetPlayerPos(playerid, dmx[playerid], dmy[playerid], dmz[playerid]);
        Dead[playerid] = 0;
        DmID[playerid] = 0;
        InDM[playerid] = 0;
    }
    return 1;
}
Reply


Messages In This Thread
Proplem with player pos - by saikumar - 08.05.2014, 14:05
Re: Proplem with player pos - by saikumar - 08.05.2014, 14:35
Re: Proplem with player pos - by BroZeus - 08.05.2014, 15:00
Re: Proplem with player pos - by NaClchemistryK - 08.05.2014, 15:01
Re: Proplem with player pos - by saikumar - 08.05.2014, 15:18
Re: Proplem with player pos - by saikumar - 08.05.2014, 15:39

Forum Jump:


Users browsing this thread: 3 Guest(s)