SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 20/06/2012, 12:00 PM   #1
Neo Karls
Big Clucker
 
Join Date: Jan 2011
Location: Kerala, India.
Posts: 138
Reputation: 16
Default Auto Car Repair Help

pawn Code:
#include <a_samp>

#define COLOR_YELLOW 0xFFFF00AA

forward FixAllCar();
new FixTimer;


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Auto Car Repair By : Brian Gutierrez ");
    print("--------------------------------------\n");
    FixTimer = SetTimer("FixAllCar",1000,true);//every 1000 milisecond we call the function "FixAllCar"
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(FixTimer); // we kill our timer on script unload.
    return 1;
}

public FixAllCar()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    // loop all possible player
    {
        if(IsPlayerConnected(playerid) && GetVehicleModel(vehicleid) == 502)
        //if the player is connected AND in a car
        {
            RepairVehicle(GetPlayerVehicleID(playerid));// set the vehicle healt
        }
    }
}


I want to make the auto repair system for car 502 (Hotrina)

Is there any error or something in above script. My Pawno is getting shut down when i compile it
__________________
If I help you? Repute me on seen left of my Posting
Neo Karls is offline   Reply With Quote
Old 20/06/2012, 12:21 PM   #2
b.rock
Little Clucker
 
Join Date: Feb 2011
Location: Angel Pine
Posts: 20
Reputation: 2
Default Respuesta: Auto Car Repair Help

change

if(IsPlayerConnected(playerid) && GetVehicleModel(vehicleid) == 502)

to

if(IsPlayerConnected(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 502)
b.rock is offline   Reply With Quote
Old 20/06/2012, 12:22 PM   #3
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 738
Reputation: 138
Default Re: Auto Car Repair Help

veicleid needs to be defined.

pawn Code:
public FixAllCar()
{
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    // loop all possible player
    {
        if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
        //if the player is connected AND in a car
        {
            if(GetVehicleModel(GetPlayerVehicleID(playerid))==502)            RepairVehicle(GetPlayerVehicleID(playerid));// set the vehicle healt
        }
    }
}
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 20/06/2012, 12:23 PM   #4
Neo Karls
Big Clucker
 
Join Date: Jan 2011
Location: Kerala, India.
Posts: 138
Reputation: 16
Default Re: Auto Car Repair Help

Ah I already fixed the Error just a while ago ,anyway Thanks
__________________
If I help you? Repute me on seen left of my Posting
Neo Karls 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Auto Repair/Auto Flip [FS] BLAbla93 Filterscripts 29 22/11/2012 10:49 AM
auto repair Madsen Help Archive 9 01/04/2011 09:32 PM
[FilterScript] [FS]Auto repair reallifescript Filterscripts 11 24/03/2011 09:53 PM
auto repair fs help.... deviljingoku Help Archive 6 19/03/2011 08:43 PM


All times are GMT. The time now is 06:20 PM.


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