10.04.2012, 22:20
@YJIET:
Not sure about sscanf, but it is possible to add some specifiers in the command processor itself.
@vpontin:
For example:
Will be like:
Not sure about sscanf, but it is possible to add some specifiers in the command processor itself.
@vpontin:
For example:
pawn Код:
rCmd_Init(addcar, "iffffii"); // Init
rCmd:addcar(playerid, success, iModel, Float: fX, Float: fY, Float: fZ, Float: fA, iColor1, iColor2) {
if(!success)
return SendClientMessage(playerid, 0xFF0000FF, "<> Syntax: /addcar [model] [x] [y] [z] [angle] [color1] [color2]");
if(!(400 <= iModel <= 611))
return SendClientMessage(playerid, 0xFF0000FF, "<> Error: Invalid model. Need to be between 400 and 611!");
CreateVehicle(iModel, fX, fY, fZ, fA, iColor1, iColor2, 60);
SendClientMessage(playerid, 0x00FF00FF, "<> You succesfully created the vehicle!");
return 1;
}
pawn Код:
rCmd_Init(createveh, "iffffii"); // Init
rCmd:createveh(playerid, success, iModel, Float: fX, Float: fY, Float: fZ, Float: fA, iColor1, iColor2) {
return cmd_addcar(playerid, success, iModel, Float: fX, Float: fY, Float: fZ, Float: fA, iColor1, iColor2);
}