Jump to content
  • 0

Question

Posted

Deci am un MINIGUN deathmatch FILTERSCRIPT...Am 2 probleme cu el;

1)Cand mor nu respawnez IN DM

2)Cand ies din dm NU dezactiveaza world bounderies-urile..

Aici este:[pawn]#include <a_samp>

#define COLOR_LIGHTBLUE    0x33CCFF19//define for lightblue

new String[256]; // String for messages

new InDM[MAX_PLAYERS]; // We will use it later to tell the script if the player is in DM or not

new Float:DMSpawns[][4] = { // Random spawns so players won't spawn at the same place

    {1410.5425,2176.3142,12.0156},

    {1370.7050,2196.3381,9.7578},

    {1416.5570,2102.6685,23.4782}

    //I will be using 3 you can add more if you want

};

public OnPlayerConnect(playerid)

{

        InDM[playerid] = 0; // This will set the player as not in DM

        return 1;

}

public OnPlayerDisconnect(playerid, reason)

{

        InDM[playerid] = 0; // Makes the player set as not in the DM

        return 1;

}

public OnPlayerSpawn(playerid)

{

    if(InDM[playerid] == 1)//This will tell the script to respawn only the players that inside DM

    {

        SetPlayerInterior(playerid, 0); // We will set the interior to 0 (you can change it to your own DM)

        SetPlayerVirtualWorld(playerid, 10); // and we will make the Virtual World in different world, so we wont mix with other players

        new rand = random(sizeof(DMSpawns)); // DM Spawn

        SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);// we will set the player position at DM

        SetPlayerFacingAngle(playerid, DMSpawns[rand][3]); // Also facing Angle

        //and we will give him weapons, I will give 2 weapons

        GivePlayerWeapon(playerid, 24, 1500); // Desert Eagle

        GivePlayerWeapon(playerid, 26, 1500); // Sawnoff Shutgun

        //you can edit them, or add more weapons

    }

    return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

    if (strcmp("/minigun", cmdtext, true, 4) == 0) //(/dm) command

    {

        new PlayerName[MAX_PLAYER_NAME];//Player name

        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

        if(InDM[playerid] == 0)//if the player is not in DM

        {//then

            InDM[playerid] = 1; // Now we will set him in DM so he will respawn at DM

            SendClientMessage(playerid, COLOR_LIGHTBLUE , "You have joined /dm, to leave type /dm again");//Message to tell him that he joined DM

            format(String, sizeof(String), "Server:{FFFFFF}%s(%d) has joined DM(/dm)", PlayerName, playerid);

            SendClientMessageToAll(COLOR_LIGHTBLUE, String);//Message to tell everyone that he joined DM

            SetPlayerInterior(playerid, 0);

SetPlayerWorldBounds(playerid, 1439.348, 1271.44, 2235.263, 2080.541); // Just like we did before we will set he's interior to 0

            SetPlayerVirtualWorld(playerid, 10); // and same here Virtual World to 10

            new rand = random(sizeof(DMSpawns)); // DM Spawn

            SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);// we will set the player position at DM

            SetPlayerFacingAngle(playerid, DMSpawns[rand][3]); // Also facing Angle

            //and we will give him weapons, I will give 2 weapons

            GivePlayerWeapon(playerid, 38, 99999); // Desert Eagle

            //you can edit them, or add more weapons if you want

        }

        else {//if the player is already in DM, he will leave

            InDM[playerid] = 0; //So now we will set him as not in DM

            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have left /dm to join again type /dm");//We will send him a message to tell him that he left

            SpawnPlayer(playerid);//We will spawn the player now

            SetPlayerHealth(playerid, 100);//set he's health to 100

            ResetPlayerWeapons(playerid);// and reset he's weapons

            SetPlayerVirtualWorld(playerid, 0);//we will set he's virtual world to 0

            SetPlayerInterior(playerid, 0);//also interior to 0

        }

        return 1;

        }

    return 0;

}[/pawn]

2 answers to this question

Recommended Posts

Posted

Poti sa stergi asta[pawn]            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have left /dm to join again type /dm");//We will send him a message to tell him that he left

            SpawnPlayer(playerid);//We will spawn the player now[/pawn]si in loc poti adauga[pawn] new rand = random(sizeof(DMSpawns)); // DM Spawn

            SetPlayerPos(playerid, DMSpawns[rand][0], DMSpawns[rand][1], DMSpawns[rand][2]);// we will set the player position at DM

GivePlayerWeapon(playerid, 38, 99999); // Desert Eagle[/pawn]

[glow=blue,2,300]SAMP.[glow=yellow,2,300]RSP-GAME[glow=red,2,300].NET[/glow][/glow][/glow]

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.