SA-MP Forums Archive
Can someone 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: Can someone help? (/showthread.php?tid=675491)



Can someone help? - JakeWayne - 14.05.2020

Hi guys.
Can someone help me with a /fixmycar command?
For example it should have it's coordinates from where to fix it, adn you go to the coordinates and type /fixmycar and it freezes you for 10 seconds, and it repairs your car with a price of probably 1k dollars.
If someone can help thanks a lot


Re: Can someone help? - Shadow0707 - 14.05.2020

Coordinates mean checkpoint? if yes, check this Here
For Freezing Here
and for timer Here
and for repairing vehicle Here

pawn Code:
Pay(playerid, Cash)
{
      //Change this to what your server uses.
    pInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + Cash;
}
to call it

pawn Code:
//this will deduct cash to player
Pay(playerid, -amount);
//this will give cash to player
Pay(playerid, +amount);



Re: Can someone help? - Adamoneoone - 14.05.2020

Quote:
Originally Posted by Shadow0707
View Post
Coordinates mean checkpoint? if yes, check this Here
For Freezing Here
and for timer Here
and for repairing vehicle Here

pawn Code:
Pay(playerid, Cash)
{
      //Change this to what your server uses.
    pInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + Cash;
}
to call it

pawn Code:
//this will deduct cash to player
Pay(playerid, -amount);
//this will give cash to player
Pay(playerid, +amount);
You didn't give him the full stuff to do it + the callbacks you gave him may not suit his enums (if he even has enums).
For a starter, just use
pawn Code:
GivePlayerMoney(playerid, amount);
amount can be negative

You may need the following:
https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Quote:

and for repairing vehicle Here
If you want to fix the car and / or cosmetic damage (including the state of the tires), you will also need:
https://sampwiki.blast.hk/wiki/UpdateVehicleDamageStatus