How to create a weapon only zone?
#1

/imageshack/i/samp001dx.png/

Ive been working on this Rocket Deathmath, there is 1 ship, and 1 dock. The players have to only use rocket launcers and kill the other players, in between the ship and the dock im working on a moving container.
How do I create a zone, that players can only use rocketlaunchers here? and not spawn other weopons or health. And how do i make it , that you can only have weapons in this zone, and when you teleport to somewhere else, you'll lose the weapons? I dont want players to have weapons on spawn, for example.
Reply
#2

pawn Код:
#include <a_samp>

new PlayerInRocketDM[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    if(PlayerInRocketDM[playerid])
    {
        if(GetPlayerWeapon(playerid) != WEAPON_ROCKETLAUNCHER)
        {
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid, WEAPON_ROCKETLAUNCHER, 200);
        }
    }
    return 1;
}

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

public OnPlayerDisconnect(playerid, reason)
{
    PlayerInRocketDM[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    PlayerInRocketDM[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInRocketDM[playerid] = 0;
    return 1;
}
Better change OnPlayerUpdate to SetTimer/Ex.
Reply
#3

But how does the script know when the player is in RocketDm?
Reply
#4

You've a command to teleport? if yes.. just put this in command:
pawn Код:
PlayerInRocketDM[playerid] = 1;
Reply
#5

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
pawn Код:
#include <a_samp>

new PlayerInRocketDM[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    if(PlayerInRocketDM[playerid])
    {
        if(GetPlayerWeapon(playerid) != WEAPON_ROCKETLAUNCHER)
        {
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid, WEAPON_ROCKETLAUNCHER, 200);
        }
    }
    return 1;
}

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

public OnPlayerDisconnect(playerid, reason)
{
    PlayerInRocketDM[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    PlayerInRocketDM[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInRocketDM[playerid] = 0;
    return 1;
}
Better change OnPlayerUpdate to SetTimer/Ex.
Missing main parts ?

Check this.
Reply
#6

IsPlayerInArea only when player leave that area. I lost about that.
Reply
#7

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
IsPlayerInArea only when player leave that area. I lost about that.
No it checks if that player is in that area when it's used with a timer. Read it again.
Reply
#8

Quote:
Originally Posted by Meyer
Посмотреть сообщение
No it checks if that player is in that area when it's used with a timer. Read it again.
Can't you see he checks with the variable, not with area?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)