/veh is letting other people use it.
#1

PHP Code:
CMD:car(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1"You must be on Administrator Command Duty to use this Command!");
    if (
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pUndercover] >=1) {
        new
            
iVehicle,
            
iColors[2];
        if(
sscanf(params"iii"iVehicleiColors[0], iColors[1])) {
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /car [model ID] [color 1] [color 2]");
        }
        else if(!(
400 <= iVehicle <= 611)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid model specified (model IDs start at 400, and end at 611).");
        }
        else if(!(
<= iColors[0] <= 255 && <= iColors[1] <= 255)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid colour specified (IDs start at 0, and end at 255).");
        }
        else for(new 
iIteratoriIterator sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
            new
                
FloatfVehPos[4];
            
GetPlayerPos(playeridfVehPos[0], fVehPos[1], fVehPos[2]);
            
GetPlayerFacingAngle(playeridfVehPos[3]);
            
CreatedCars[iIterator] = CreateVehicle(iVehiclefVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
            
VehicleFuel[CreatedCars[iIterator]] = 100.0;
            
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
            return 
SendClientMessageEx(playeridCOLOR_GREY"Car spawned!");
        }
    }
    else 
SendClientMessageEx(playeridCOLOR_GREY"ERROR: Command is not in your authority to be used!");
    return 
1;

When Im ingame players also can use the /car Command how do I fix it?
Reply
#2

This Should Fix It;

PHP Code:
CMD:car(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1"You must be on Admin Duty to use this Command!");
    if (
PlayerInfo[playerid][pAdmin] >= 4) {
        new
        
iVehicle,
        
iColors[2];
        if(
sscanf(params"iii"iVehicleiColors[0], iColors[1])) {
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /veh [model ID] [color 1] [color 2]");
        }
        else if(!(
400 <= iVehicle <= 611)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid model specified (model IDs start at 400, and end at 611).");
        }
        else if(!(
<= iColors[0] <= 255 && <= iColors[1] <= 255)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid colour specified (IDs start at 0, and end at 255).");
        }
        else for(new 
iIteratoriIterator sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
            new
            
FloatfVehPos[4];
            
GetPlayerPos(playeridfVehPos[0], fVehPos[1], fVehPos[2]);
            
GetPlayerFacingAngle(playeridfVehPos[3]);
            
CreatedCars[iIterator] = CreateVehicle(iVehiclefVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
            
VehicleFuel[CreatedCars[iIterator]] = 100.0;
            
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
            return 
SendClientMessageEx(playeridCOLOR_GREY"Vehicle spawned!");
        }
    }
    else 
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command!");
    return 
1;

Reply
#3

Argh sorry again didin't real the whole thing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)