Author Topic: help me  (Read 3679 times)

0 Members and 1 Guest are viewing this topic.

Offline johnx

  • Street Thug
  • *
  • Posts: 25
    • View Profile
help me
« on: January 09, 2011, 12:59:37 pm »
how to stop fixing hunter from !fix command can anyone tell me or give me cods to stop !fix command to fixing hunter and sea sparrow

Offline Call_me_Dad

  • Street Thug
  • *
  • Posts: 2
    • View Profile
Re: help me
« Reply #1 on: January 09, 2011, 02:49:11 pm »
Find out the vehicle ID of Hunter and Sea sparrow.

then add:
Code: [Select]
else if ((GetPlayerVehicleID(playerid)==HUNTER_ID) || (GetPlayerVehicleID(playerid)==SPARROW_ID)) SendClientMessage(playerid,COLOR_RED,"You cant fix this vehicle");
to ur command

Offline johnx

  • Street Thug
  • *
  • Posts: 25
    • View Profile
Re: help me
« Reply #2 on: January 09, 2011, 03:40:48 pm »
not working

if(strcmp(cmd,"!fix",true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid,COLOR_GREY,"You're not in a vehicle!");
            if ((GetPlayerVehicleID(playerid)==155) || (GetPlayerVehicleID(playerid)==177)) SendClientMessage(playerid,COLOR_RED,"You cant fix this vehicle");
            return 0;
   }
        SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
      SetVehicleLights(GetPlayerVehicleID(playerid), 1);
        SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
   SendClientMessage(playerid,COLOR_YELLOW,"Your car has been fixed!");
   return 0;

      return 1;
}

Offline JoJo_boy

  • Street Thug
  • *
  • Posts: 12
  • LMAO !!
    • View Profile
Re: help me
« Reply #3 on: January 09, 2011, 05:23:48 pm »
Code: [Select]
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");
            return 1;
  }
else {
SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
SetVehicleLights(GetPlayerVehicleID(playerid), 1);
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
SendClientMessage(playerid,COLOR_YELLOW,"Your car has been fixed!");
return 1;
}
return 1;
}

i think this might work ( im not sure about if its "else if" or "elseif" )

Offline Call_me_Dad

  • Street Thug
  • *
  • Posts: 2
    • View Profile
Re: help me
« Reply #4 on: January 10, 2011, 01:38:33 am »
Code: [Select]
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), 1);
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
SendClientMessage(playerid,COLOR_YELLOW,"Your car has been fixed!");

}
         return 1;
}

Offline johnx

  • Street Thug
  • *
  • Posts: 25
    • View Profile
Re: help me
« Reply #5 on: January 10, 2011, 08:34:58 am »
it gives these errors
Quote
D:\VCMPSE~1\MYSERV~1\GAMEMO~1\GUPS11~1.PWN(1713) : error 001: expected token: ";", but found "if"
D:\VCMPSE~1\MYSERV~1\GAMEMO~1\GUPS11~1.PWN(1713) : error 029: invalid expression, assumed zero

Offline johnx

  • Street Thug
  • *
  • Posts: 25
    • View Profile
Re: help me
« Reply #6 on: January 10, 2011, 08:40:47 am »
WorKed thnx
« Last Edit: January 11, 2011, 08:25:50 am by johnx »

Offline [GCK]KoFFe

  • Street Thug
  • *
  • Posts: 27
    • View Profile
Re: help me
« Reply #7 on: January 10, 2011, 03:35:05 pm »
AOAOAOAOAOA >:(