Repair car
#1

I have tried to figure out this problem with doing a Command called /fix but I fail everytime I doing it.
Could someone post a exemple on how it could look like, please.

//Al
Reply
#2

pawn Код:
if(strcmp(cmdtext,"/fix",true) == 0)
{
  if(GetPlayerState != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,red,"You need to be driving a vehicle!");
  SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
  SendClientMessage(playerid,COLOR_YELLOW,"Vehicle fixed");
  return 1;
}
There's a simple example for you
Reply
#3

Quote:
Originally Posted by JaTochNietDan
pawn Код:
if(strcmp(cmdtext,"/fix",true) == 0)
{
  if(GetPlayerState != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,red,"You need to be driving a vehicle!");
  SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
  SendClientMessage(playerid,COLOR_YELLOW,"Vehicle fixed");
  return 1;
}
There's a simple example for you
I started yesterday to script and I'm not the best on script.
here you got the repair script that I tried to get working.

pawn Код:
if (strcmp("/fix",cmdtext,true)==0){
IsPlayerInAnyVehicle(playerid);
SetVehicleHealth(vehicleid,1000.0);
SendClientMessage(playerid,TEAM_slytherin_COLOR,"Car is repaired.");
return 1;
  }
Reply
#4

pawn Код:
if (!strcmp("/fix",cmdtext,true))
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
        SendClientMessage(playerid,TEAM_slytherin_COLOR, "Car is repaired.");
    }
    return 1;
}
That's more along the lines of what you were doing.
Reply
#5

Quote:
Originally Posted by Weirdosport
pawn Код:
if (!strcmp("/fix",cmdtext,true))
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
        SendClientMessage(playerid,TEAM_slytherin_COLOR, "Car is repaired.");
    }
    return 1;
}

That's more along the lines of what you were doing.
Ahh, Thanks... I see... :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)