15.08.2011, 05:50
You could mabe use a input style dialog for that, yeah?
Anyway Hope this helps
at the top
in your command simply check if the player is in a vehicle & also if they are the driver.
under "OnDialogResponse" for the "PLATETEXTMENU" simply add...
doing it this way you can use stuff like "{000011}Darnell" which would insert your name on the license plate in black, other colours work too pawn Код:
#define PLATETEXTMENU 1234 //number can be anything not used by your scripts
pawn Код:
//changeplate
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid, PLATETEXTMENU , DIALOG_STYLE_INPUT, "Personal Numberplate", "Insert plate text", "Accept", "Cancel");//
//else don't do anything OR "Sendclientmsg - You must be driving a vehicle"
pawn Код:
if(response)
{
new Float:vx, Float:vy, Float:vz, Float:vang;//
GetVehiclePos(GetPlayerVehicleID(playerid), vx ,vy, vz);//
GetVehicleZAngle(GetPlayerVehicleID(playerid), vang);//
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), inputtext);//
SetVehicleToRespawn(GetPlayerVehicleID(playerid));//
SetVehiclePos(GetPlayerVehicleID(playerid), vx, vy, vz);//
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);//
SetVehicleZAngle(GetPlayerVehicleID(playerid), vang);//
//add your other needed code here....
}
Anyway Hope this helps