Police Case Remove By Going Pickup - 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: Police Case Remove By Going Pickup (
/showthread.php?tid=324750)
Police Case Remove By Going Pickup -
emon - 10.03.2012
Hello,
as i am trying to finding a script that.Example: like a player have 4 start case and he want to pay by pickup a start icon and he pay some money and the start's gone,something like this ,,is there any script or example help me?
Re: Police Case Remove By Going Pickup -
Faisal_khan - 10.03.2012
Try this:
[Tutorial] [TUT]How to make Pickups.
Re: Police Case Remove By Going Pickup -
ReneG - 10.03.2012
This is an example on how to do it.
pawn Код:
new
starpickup, // A new variable that will hold the pickup
price; // A variable to hold how much they have to pay.
public OnGameModeInit()
{
// This assings the variable to CreatePickup for later use.
starpickup = CreatePickup(/* Your params go here*/);
return 1;
}
public OnPlayerPickupPickUp(playerid,pickupid)
{
if(pickupid == starpickup) // If they go into the pickup
{
new wantedlevel = GetPlayerWantedLevel(playerid); // A variable that holds their wanted level.
if(wantedlevel > 0) // If they have more than one star
{
price = wantedlevel*1000; // Then the price is 1,000 per star.
new string[124];
format(string,sizeof(string),"Use /payfine to pay off your stars. The price will be $%d.",price);
SendClientMessage(playerid,-1,string);
return 1;
}
// If they don't have a wanted level it sends the message below.
else return SendClientMessage(playerid,-1,"You don't have a wanted level.");
}
return 1;
}
CMD:payfine(playerid,params[])
{
if(GetPlayerMoney < price) // If they don't have enough money
{
// Then it sends the message.
return SendClientMessage(playerid,-1,"You don't have enough money!");
}
else // If they DO have enough money
{
GivePlayerMoney(playerid,-price); // Takes away the money they used
SetPlayerWantedLevel(playerid,0); // Takes away their wanted level
SendClientMessage(playerid,-1,"You are no longer wanted.");
return 1;
}
return 1;
}