3 Pickupable, respawns after death
#include <a_samp>
#include <streamer>
new ReduceWantedLevelStar[4];
public OnFilterScriptInit()
{
ReduceWantedLevelStar[0] = AddStaticPickup(1247, 2, 2163.107910, 2473.048095, 10.820312, 0);
ReduceWantedLevelStar[1] = AddStaticPickup(1247, 2, 1179.600219, 873.894409, 11.612189, 0);
ReduceWantedLevelStar[2] = AddStaticPickup(1247, 2, 2161.824218, 2268.165039, 18.843717, 0);
ReduceWantedLevelStar[3] = AddStaticPickup(1247, 2, 2853.885253, 642.362365, 35.844734, 0);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(ReduceWantedLevelStar[3])
{
new wanted = GetPlayerWantedLevel(playerid);
if(wanted == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "You is not wanted.");
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Your wanted level has been reduced");
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) -1);
return 1;
}
}
return 0;
}
if(pickupid == ReduceWantedLevelStar[3])

DestroyPickup(ReduceWantedLevelStar[3]); //For example
|
Apart from what JaTochNietDan said, that should work to be honest, but you could try destroying the pickup when someone picks it up
![]() pawn Код:
|
|
Well for one thing, the if statement makes no sense, you are just checking if the variable "ReduceWantedLevelStar[3]" is true, which it will be recognized as in this case.
You need to compare it to something, I assume you want to check if it's the pickup that was picked up, then you should make the if statement compare the variable holding the pickupid with the pickupid passed by the callback, for example: pawn Код:
|
|
Apart from what JaTochNietDan said, that should work to be honest, but you could try destroying the pickup when someone picks it up
![]() pawn Код:
|
|
Yeah, Thanks, helped alot :P
But doesnt that destroy my pickup till i restart the server? |
|
Yes, additionally it only works with pickups created with the CreatePickup function and not the AddStaticPickup function.
|