30.04.2012, 22:07
'return' stops the code - therefore 'else' is a waste:
- You put a ( after the CreateVehicle line, it should have been a }.
- Coordinates shifted so vehicle doesn't spawn on top of players.
- Sscanf removed - no need if there's only one parameter (also 'u' is a PLAYER, it won't work for a vehicle ID.
pawn Код:
CMD:veh(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, " ** You must be a level 3 Admin to use that! ");
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Use /veh [vehicle id]");
if(strval(params) < 400 || strval(params) > 611) return SendClientMessage(playerid, COLOR_RED, "Invalid vehicle model.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(strval(params), x+2, y+2, z, 90.0, 0, 0, 0);
return 1;
}
- Coordinates shifted so vehicle doesn't spawn on top of players.
- Sscanf removed - no need if there's only one parameter (also 'u' is a PLAYER, it won't work for a vehicle ID.

