Pickup Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pickup Help (
/showthread.php?tid=331732)
Pickup Help -
Dr - 05.04.2012
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...
Respuesta: Pickup Help -
Chris1337 - 05.04.2012
what you want to happend?
have you defined your Pickup on GAMEMODEINIT?
and this?
if(pickupid == anything)
Re: Pickup Help -
Dr - 05.04.2012
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
Respuesta: Pickup Help -
Chris1337 - 05.04.2012
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
Re: Respuesta: Pickup Help -
TzAkS. - 05.04.2012
You need to create the pick up first.
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;
}