Pickup Help
#1

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new vehid = GetPlayerVehicleID(playerid);
    if(IsACopCar(vehid))
    {
        SendClientMessage(playerid, COLOR_GREY, "Right car!");
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "Wrong car!");
    }
    return 1;
}
But when I pickup the pickup with a non cop car, nothing happens...
Reply
#2

what you want to happend?

have you defined your Pickup on GAMEMODEINIT?


and this?

if(pickupid == anything)
Reply
#3

Nope thats not what I want, there is only one pickup and I want it so when the player picks it up, if they are in a police car it tells them right car, if not, then wrong car... But it only does right car, not wrong car
Reply
#4

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new vehid = GetPlayerVehicleID(playerid);
    if(IsACopCar(vehid))
    {
        SendClientMessage(playerid, COLOR_GREY, "Right car!");
    }
    else if(!IsACopCar(vehid))
    {
        SendClientMessage(playerid, COLOR_GREY, "Wrong car!");
    }
    return 1;
}
try that
Reply
#5

You need to create the pick up first.
pawn Код:
new coppickup;
pawn Код:
coppickup= CreatePickup(1239, 23,  x y z , -1);
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == coppickup)
    {
        new vehid = GetPlayerVehicleID(playerid);
        if(IsACopCar(vehid))
        {
            SendClientMessage(playerid, COLOR_GREY, "Right car!");
        }
        else if(!IsACopCar(vehid))
        {
            SendClientMessage(playerid, COLOR_GREY, "Wrong car!");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)