Quote:
Originally Posted by MP2
'return' stops the code - therefore 'else' is a waste:
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; }
- 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.
|
Thanks MP2 you actually helped apart from people who just paste some code and say "There" you actually explain where i am going wrong so thank you <3
P.S. I am making NOOB mistakes as i have a mac and coding on a mac and compiling for some reason at only 64 bytes is kinda weird and frustrating -.-, To compile i have to explain and send it to my friends