Quote:
Originally Posted by Calgon
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Your car has not been tuned as you're not in one."); TuneVehicleRandomly(GetPlayerVehicleID(playerid)); return SendClientMessage(playerid,-1,"Your car has been tuned."); } return 0; }
Using GetPlayerVehicleID() informs the script of the vehicle ID you want. It selects the vehicle ID the player is currently in who executes the command.
I've added a check to ensure the player is even in a vehicle too, and removed the pointless return.
|
THANKS A LOT MAN THIS WORK!!
THANK ANYWAYS TO ALL OTHERS THAT HAVE HELPED ME OUT!