05.10.2016, 07:57
Hello there.
I'm wondering how can I switch 2 type of values with sscanf. What I mean?
Example, a player have to type the ID of a vehicle OR the plate of the vehicle.
So.. how can I make it?
If I type nothing after /rplate, I've "Error" message. If I type an ID, this working too but if I type a plate I've "/rplate" message. I think because I is optionnal but I can't pass it.
So, I hope you understand what I mean.
Thanks you'!
I'm wondering how can I switch 2 type of values with sscanf. What I mean?
Example, a player have to type the ID of a vehicle OR the plate of the vehicle.
So.. how can I make it?
PHP код:
CMD:rplate(playerid, params[])
{
if(!GetPlayerVehicleID(playerid)) return SCM(playerid, RED, "You must be in a vehicle.");
new
target,
plate[12+EOS] = EOS;
if(sscanf(params, "I(65535)S()[12]", target, plate))
return SCM(playerid, LBLUE, "/rplate [blabla]");
if(target == INVALID_VEHICLE_ID && strval(plate) < 2)
return SCM(playerid, RED, "Error");
So, I hope you understand what I mean.
Thanks you'!