Pickup only for a specific team
#1

Hi,i need little help.

In my gm i've definied team with gTeam.

I need to make a pickup working only for a team (In this case,Swat).

How to?
Reply
#2

BUMPPP
Reply
#3

Do you use a pickup stremer? if you use incognitos plugin you can easily show pickups for certain players only with the playerid parameter.
Reply
#4

Explain more please... Pickup like what?
Reply
#5

Quote:
Originally Posted by Berky
Посмотреть сообщение
Explain more please... Pickup like what?
What do you think he means by pickup? I'm guessing pickups!
Reply
#6

UNTESTED and Off the top of my head...

pawn Код:
public OnPlayerPickupPickUp()
{
// START
// Pickup Code
if(pickup == pickup)
{
if(gTeam[playerid] == Team)
{
// Code Here
}
return 1;
}

// END
return 1;
}
Reply
#7

What do you wanna make, pickups ONLY displaying for a certain faction, OR pickups ONLY WORKING for a certain faction?
Reply
#8

Quote:
Originally Posted by Berky
Посмотреть сообщение
What do you wanna make, pickups ONLY displaying for a certain faction, OR pickups ONLY WORKING for a certain faction?
Read the origional post he said working for a speciifc team only.
Reply
#9

firstly, choose a pickup type that will suit your needs ( 23 is a good choice )
https://sampwiki.blast.hk/wiki/PickupTypes
pawn Код:
new your_pickup = CreatePickup( <insert your parameters here > );

public OnPlayerPickupPickup(playerid, pickupid)
{
     if(gTeam[playerid] == 2) //or whatever team you want to be able to access the pickup
     {
          // put your code here, for whatever you want to do
     }
     return 1;
}
I have not used non-streamed pickups for quite a while, but this should work, if you put some effort into adding the code that you need to do what you want to do here.
Reply
#10

I'll give you a nice way to do it incase you do use the streamer plugin. I've used these callbacks as an example i dont know where you need this. Unless im mistaken these pickups wont even show on other players screens.
pawn Код:
#include <a_samp>
#include <streamer>

#define MAX_T_PICKUPS           (50)//changme

#define SWAT                    (1)

new gTeam[MAX_PLAYERS];

new TeamPickups[MAX_PLAYERS][MAX_T_PICKUPS];

public OnPlayerConnect(playerid)
{
    gTeam[playerid] = SWAT;
    return 1;
}

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

public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == SWAT)
    {
        TeamPickups[playerid][0] = CreateDynamicPickup(28, 23, 0.0, 0.0, 0.0, -1, -1, playerid, 100.0);//swap co-ords obviously
        TeamPickups[playerid][1] = CreateDynamicPickup(29, 23, 0.0, 0.0, 0.0, -1, -1, playerid, 100.0);
    }
    return 1;
}
Without the streamer only think that comes to my mind that might work is this, (and what the nice people above said)
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == swatpickup && gTeam[playerid] != SWAT) return 0;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)