05.12.2010, 10:02
I've trying to create like command what will give you the car (by his ID) you want.
It works pretty nicely, but I've got one small problem what I can't think of way to get rid.
So this is the code:
The dialog when you call the " /veh " command:
And the problem is when i put like 20 in the dialog box, and we all know that there is no car with ID 20.
But I still get the message " You got your car! ".
It works pretty nicely, but I've got one small problem what I can't think of way to get rid.
So this is the code:
The dialog when you call the " /veh " command:
pawn Код:
ShowPlayerDialog(playerid, ADMIN_CARSID_DIALOG,DIALOG_STYLE_INPUT,"Vehicle ID","Please enter ID of your vehicle.","Spawn","Cancel");
pawn Код:
if(dialogid == ADMIN_CARSID_DIALOG)
{
if(!response) return SendClientMessage(playerid, COLOR_LIGHTRED, " You Canceled!");
new carid = strval(inputtext);
if(!IsNumeric(inputtext)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Please use numbers as a ID of your car. [HINT]: Please use ID 400-605.");
if(inputtext[0] > 400 || inputtext[0] < 605)// Here is the problem, I think. :S
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerFacingAngle(playerid, A);
GetPlayerPos(playerid,X, Y, Z);
AdminCar = AddStaticVehicle(carid, X+2, Y+3, Z, A, 0, 0);
SendClientMessage(playerid, COLOR_GREEN, " You got your car!");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, but we can't find a car with ID you wanted. [HINT]: Please use ID 400-605.");
}
But I still get the message " You got your car! ".