07.10.2010, 20:20
Код:
if (!strcmp (cmdtext,"/spawncar", true)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /spawncar [modelid]"); return 1; } new thecar = strval(tmp); if(IsPlayerAdmin(playerid)) //Is the player rcon admin? { if(thecar > 399 && thecar < 612) { if(!IsPlayerInAnyVehicle(playerid)) //the "!" means that if "IsPlayerInVehicle" returns false, the code will execute, if not, the return code will. { GetPlayerPos(playerid, Float:X, Float:Y, Float:Z); GetPlayerFacingAngle(playerid, Float:Angle); CreateVehicle(thecar, X, Y, Z + 2.0, Angle + 90.0, -1, -1, 5000); return 1; } return SendClientMessage(playerid,0xFF0000FF,"You are already in a vehicle!"); //If the player already is in a vehicle, this will happen } return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID"); } return SendClientMessage(playerid,0xFF0000FF,"Access denied!"); //If the player wasn't logged in to rcon, this happens. }