09.07.2013, 02:08
Take this code and place it somewhere down your script. I keep all my admin commands in one group and all my player commands in a separate group to keep it tidy.
ZCMD doesn't require the code to be in OnPlayerCommandText.
EDIT: Also; this line will execute if someone is actually allowed to do it.
Add 'else' to the beginning of the line. So:
pawn Код:
CMD:veh(playerid,params[])
{
new ModelID, color[2],Float:VehPos[4], vehicleid;
if(GetPlayerState(playerid)!=PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,0xB0AFB0FF,"You cannot spawn vehicles if you are already inside a vehicle!");
if(sscanf(params, "ddd",ModelID,color[0],color[1])) return SendClientMessage(playerid,0xB0AFB0FF, "/veh [vehicleid] [color1] [color2]");
if(ModelID < 400 || ModelID > 611) return SendClientMessage(playerid,0xB0AFB0FF, "The vehicle id must be between 400 - 611");
if(color[0] < 0 || color[0] > 255 || color[1] < 0 || color[1] > 255) return SendClientMessage(playerid,0xB0AFB0FF, "The colorid must be between 0 - 126");
if(IsPlayerAdmin(playerid))
{
GetPlayerPos(playerid, VehPos[0],VehPos[1],VehPos[2]);
GetPlayerFacingAngle(playerid, VehPos[3]);
vehicleid = CreateVehicle(ModelID,VehPos[0],VehPos[1],VehPos[2],VehPos[3],color[0],color[1],-1);
LinkVehicleToInterio(vehicleid,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(vehicleid,GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, vehicleid, 0);
}
SendClientMessage(playerid,RED,"[AcC] You do not have enough Admin Permissions to execute this Command!");
return 1;
}
EDIT: Also; this line will execute if someone is actually allowed to do it.
pawn Код:
SendClientMessage(playerid,RED,"[AcC] You do not have enough Admin Permissions to execute this Command!");
pawn Код:
else SendClientMessage(playerid,RED,"[AcC] You do not have enough Admin Permissions to execute this Command!");