Dm Help respawn
#2

EDIT:
pawn Код:
#include <a_samp>
#define COLOR_LIGHTBLUE    0x33CCFF19
#include       <zcmd>

new String[256];
new InDM[MAX_PLAYERS];

new Float:DMSpawns[][4] =
{
    {247.5956,1458.5726,43.0946,185.8330},
    {199.6086,1394.2821,43.0946,350.1746},
    {247.5956,1458.5726,43.0946,185.8330},
    {167.4688,1426.9861,26.2922,244.9503},
    {186.0784,1456.1190,60.1355,184.6759},
    {246.0688,1410.4255,23.3703,94.1182},
    {287.6833,1411.3716,10.3918,82.7555}
};

public OnPlayerConnect(playerid)
{
    InDM[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(InDM[playerid] == 1)
    {
        //set the players position to the DM
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    InDM[playerid] = 0;
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(InDM[playerid] == 1)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 10);
        new rand = random(sizeof(DMSpawns));
        SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
        GivePlayerWeapon(playerid, 35, 1500); // RPG
        GivePlayerWeapon(playerid, 36, 1500); // HS Rocket
    }
    return 1;
}
CMD:rocket(playerid)
{
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(InDM[playerid] == 0)
    {
        InDM[playerid] = 1;
        SendClientMessage(playerid, COLOR_LIGHTBLUE , "You have joined /rocket, to leave type /rocket again");
        format(String, sizeof(String), "Server:{FFFFFF}%s(%d) has joined RocketDM(/rocket)", PlayerName, playerid);
        SendClientMessageToAll(COLOR_LIGHTBLUE, String);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 10);
        new rand = random(sizeof(DMSpawns));
        SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);position at DM
        SetPlayerFacingAngle(playerid, DMSpawns[rand][3]);
        GivePlayerWeapon(playerid, 35, 1500); // RPG
        GivePlayerWeapon(playerid, 36, 1500); // HS Rocket
    }
    else
    {
        InDM[playerid] = 0;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have left /rocket to join again type /rocket");
        SpawnPlayer(playerid);
        SetPlayerHealth(playerid, 50);
        ResetPlayerWeapons(playerid);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Reply


Messages In This Thread
New help me player run time error - by kalanerik99 - 01.05.2013, 16:56
Re: Dm Help respawn - by Faisal_khan - 01.05.2013, 17:01
Re: Dm Help respawn - by kalanerik99 - 01.05.2013, 18:45
Re: Dm Help respawn - by Faisal_khan - 02.05.2013, 06:03
Re: Dm Help respawn - by kalanerik99 - 02.05.2013, 06:18
Re: Dm Help respawn - by Faisal_khan - 02.05.2013, 08:50
Re: Dm Help respawn - by kalanerik99 - 02.05.2013, 10:19

Forum Jump:


Users browsing this thread: 1 Guest(s)