SA-MP Forums Archive
[FilterScript] Comand repair vehicle don't work... - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Comand repair vehicle don't work... (/showthread.php?tid=210199)



Comand repair vehicle don't work... - Macros50 - 12.01.2011

Hi all, sorry if the section is wrong. I have the command to repair the vehicles in SA-MP, but don't repair, that I write /fix and send me the message Fixed Vehicle, but the car does not repair the damage left with ... know how? here's the code pawn and sorry my English i'm italian.


if ( strcmp ( cmdtext , "/fix", true)==0)
{
new State=GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{

RepairVehicle(vehicleid);
SendClientMessage(playerid,COLOR_GREEN,"Vehicle Fixed!");
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"You aren't in any vehicle.");
}
return 1;
}


Re : Comand repair vehicle don't work... - cristab - 12.01.2011

Код:
if ( strcmp ( cmdtext , "/fix", true)==0)
{
new State=GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
new veh=GetPlayerVehicleID(playerid);
RepairVehicle(veh);
SendClientMessage(playerid,COLOR_GREEN,"Vehicle Fixed!");
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"You aren't in any vehicle.");
}
return 1;
}



Re: Comand repair vehicle don't work... - Drowzz - 12.01.2011

Wrong section


Re: Comand repair vehicle don't work... - California - 12.01.2011

Indent your code. You can read it better.

pawn Код:
if(!strcmp(cmdtext, "/fix", true))
{
    if(IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid, PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        RepairVehicle(vehicleid);
        SendClientMessage(playerid, COLOR_GREEN, "You have fixed your vehicle!");
    }
    else
    {
        SendClientMessage(playerid, COLOR_BLUE, "You are not in a vehicle.");
    }
    return 1;
}



Re: Comand repair vehicle don't work... - jordy.kiesebrink - 12.01.2011

I run this REPAIR line at the moment and it works great you may use it if you want:

pawn Код:
if(strcmp(cmdtext, "/vr", true) == 0 || strcmp(cmdtext, "/repair", true) == 0)
    {
   
    if(IsPlayerInAnyVehicle(playerid))
    {
       RepairVehicle(GetPlayerVehicleID(playerid));
       SendClientMessage(playerid,0xC0C0C0AA,"Car is ful repaird");


    } else SendClientMessage(playerid,0xC0C0C0AA,"You have not got a vehicle!");

    return 1;
    }