Police Case Remove By Going Pickup
#1

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?
Reply
#2

Try this:
[Tutorial] [TUT]How to make Pickups.
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)