Author Topic: help me  (Read 2994 times)

0 Members and 1 Guest are viewing this topic.

Offline abdulfussy

  • Street Thug
  • *
  • Posts: 13
  • Trust No One
    • View Profile
help me
« on: January 26, 2013, 02:30:06 pm »
i want to change fix cmd to auto fix cmd how i do that plz tell me [pawn]   }
else if(strcmp(cmd,"!fix",true) == 0)
{
   if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_GREY,"You're not in a vehicle!");
              else if ( (GetPlayerVehicleID(playerid) == 155) || ( GetPlayerVehicleID(playerid) == 177) ) SendClientMessage(playerid,COLOR_RED,"You cant fix this vehicle");
      else {
         SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
         SetVehicleLights(GetPlayerVehicleID(playerid), 0);
         SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
         SendClientMessage(playerid,COLOR_YELLOW,"Your car has been fixed!");
      }
            return 1;[/pawn]
« Last Edit: January 26, 2013, 02:42:32 pm by abdulfussy »


Offline shaheersa

  • Street Thug
  • *
  • Posts: 17
    • View Profile
Re: help me
« Reply #1 on: January 26, 2013, 02:56:24 pm »
put this on where you can find it can be put

[pawn]public autofix(playerid)
{
      if(!IsPlayerInAnyVehicle(playerid)) return 1;
              else if ( (GetPlayerVehicleID(playerid) == 155) || ( GetPlayerVehicleID(playerid) == 177) ) return 1;
      else
         {
         SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
         SetVehicleLights(GetPlayerVehicleID(playerid), 0);
         SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
         }
}
[/pawn]

put this under onplayerconnect

[pawn]public OnPlayerConnect(playerid)
{
   new plaque[244];
   format(plaque,244,"autofix(playerid)");
   SetTimer(plaque, 10, 1)
}[/pawn]


it will auto-fix the vehicle (god-mode for vehicle)
NOTE: THIS IS NOT TESTED SO MAKE A BACKUP OF SCRIPT

Offline abdulfussy

  • Street Thug
  • *
  • Posts: 13
  • Trust No One
    • View Profile
Re: help me
« Reply #2 on: January 26, 2013, 03:41:14 pm »
no i need a cmd like /c autofix on and /c autofix off


Offline shaheersa

  • Street Thug
  • *
  • Posts: 17
    • View Profile
Re: help me
« Reply #3 on: January 26, 2013, 04:15:39 pm »
no i need a cmd like /c autofix on and /c autofix off

put this on where you can find it can be put

[pawn]public autofix(playerid)
{
      if(!IsPlayerInAnyVehicle(playerid)) return 1;
              else if ( (GetPlayerVehicleID(playerid) == 155) || ( GetPlayerVehicleID(playerid) == 177) ) return 1;
      else
         {
         SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
         SetVehicleLights(GetPlayerVehicleID(playerid), 0);
         SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
         }
}[/pawn]

put this under onplayercommandtext

[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp(cmd, "autofix", true) == 0)
 {
       tmp = strtok(cmdtext, idx);
        if (!strlen(tmp)) SendClientMessage(playerid, 0x660000AA,"Error: Invalid Syntax - Use /c autofix [on/off]";
       else {
         if(strcmp(tmp, "on", true) == 0)
          {
         new plaque[244];
         format(plaque,244,"autofix(playerid)");
         SetTimer(plaque, 10, 1);
         }
          else if(strcmp(tmp, "off", true) == 0)
         {
         KillTimer(0);
         return 1;
         }[/pawn]

it will auto-fix the vehicle (god-mode for vehicle)
NOTE: THIS IS NOT TESTED SO MAKE A BACKUP OF SCRIPT AND THIS WILL ONLY WORK IF YOU DONT HAVE OTHER TIMERS
« Last Edit: January 26, 2013, 04:17:32 pm by shaheersa »