SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/05/2020, 01:08 AM   #1
JakeWayne
Little Clucker
 
Join Date: Mar 2020
Posts: 32
Reputation: 0
Default Can someone help?

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
JakeWayne is offline   Reply With Quote
Old 14/05/2020, 04:11 AM   #2
Shadow0707
Big Clucker
 
Join Date: Sep 2016
Posts: 92
Reputation: 7
Default Re: Can someone help?

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);
Shadow0707 is offline   Reply With Quote
Old 14/05/2020, 09:35 AM   #3
Adamoneoone
Huge Clucker
 
Join Date: Sep 2014
Posts: 488
Reputation: 37
Default Re: Can someone help?

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://wiki.sa-mp.com/wiki/GetPlayerDistanceFromPoint
https://wiki.sa-mp.com/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://wiki.sa-mp.com/wiki/UpdateVehicleDamageStatus
__________________
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!
Adamoneoone is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.