PDA

View Full Version : Pickup Help


Dr
05/04/2012, 07:57 PM
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...

Chris1337
05/04/2012, 08:00 PM
what you want to happend?

have you defined your Pickup on GAMEMODEINIT?


and this?

if(pickupid == anything)

Dr
05/04/2012, 08:27 PM
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

Chris1337
05/04/2012, 08:52 PM
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

TzAkS.
05/04/2012, 09:05 PM
You need to create the pick up first.
new coppickup;

coppickup= CreatePickup(1239, 23, x y z , -1);

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;
}