Multiple issues
#1

I have several issues with unknown command messages which show up after the said command has been executed, I'm certainly new to writing in pawn so I have no idea on how to fix them, even though I tried multiple things, it does not seem to work properly.

First I have an issue with the following command which replies Unknown command after it executed:

Код:
CMD:vmove(playerid, params[]) {
	if(playerData[playerid][pAdmin] >= 4 || groupPermission(playerid, "go")) {
	    if(GetPlayerInterior(playerid) > 0)
	        return SendClientMessage(playerid, COLOR_GRAD1, "You cannot create vehicles inside interiors.");
	        
	    if(!IsPlayerInAnyVehicle(playerid))
			return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to move.");

		new
			string[45];

        for(new x = 0; x < MAX_VEHICLES; x++) {
            if(DynamicVehicleData[x][v_iVehicleScriptID] == GetPlayerVehicleID(playerid)) {

                GetVehiclePos(DynamicVehicleData[x][v_iVehicleScriptID], DynamicVehicleData[x][v_fVehiclePosition][0], DynamicVehicleData[x][v_fVehiclePosition][1], DynamicVehicleData[x][v_fVehiclePosition][2]);
				GetVehicleZAngle(DynamicVehicleData[x][v_iVehicleScriptID], DynamicVehicleData[x][v_fVehicleRotation]);

				DestroyVehicle(DynamicVehicleData[x][v_iVehicleScriptID]);
				DynamicVehicleData[x][v_iVehicleScriptID] = createVehicle(DynamicVehicleData[x][v_iVehicleModelID], DynamicVehicleData[x][v_fVehiclePosition][0], DynamicVehicleData[x][v_fVehiclePosition][1], DynamicVehicleData[x][v_fVehiclePosition][2], DynamicVehicleData[x][v_fVehicleRotation], DynamicVehicleData[x][v_iVehicleColour][0], DynamicVehicleData[x][v_iVehicleColour][1], 60000);
				PutPlayerInVehicleEx(playerid, DynamicVehicleData[x][v_iVehicleScriptID], 0);

                saveVehicle(x);

				format(string, sizeof(string), "You have successfully moved the %s (VID %i).", VehicleName[GetVehicleModel(DynamicVehicleData[x][v_iVehicleModelID]) - 400], DynamicVehicleData[x][v_iVehicleModelID]);
				SendClientMessage(playerid, COLOR_WHITE, string);
				return 1;
			}
        }
        SendClientMessage(playerid, COLOR_GRAD1, "You cannot move this vehicle.");
	}
	else Invalid_Admin(playerid);
	return 1;
}
Secondly I get the exact same issue with the following NOS command after execution:

Код:
CMD:nos(playerid, params[]){
	new 
		carid = GetPlayerVehicleID(playerid),
		string[128],
		closestcar = GetClosestCar(playerid, carid),
		nostogive,
		level = PlayerData[playerid][pMechSkill];
            
    if(JobData[PlayerData[playerid][pJobID]][j_iType] == 2 || JobData[PlayerData[playerid][pJobID2]][j_iType] == 2 || PlayerData[playerid][pAdmin] >= 1 && PlayerData[playerid][pAdminDuty] == 1) {
    	
		if(GetPVarInt(playerid, "InEvent") == 1)
			return SendClientMessage(playerid, COLOR_GRAD1, "You can't use this while in an event.");

	    if(IsPlayerInAnyVehicle(playerid))
			return	SendClientMessage(playerid, COLOR_GRAD1, "You must be outside of a vehicle to use this.");
            
        if(PlayerData[playerid][pNosTime] >= 1)
    	{
	    	format(string, sizeof(string), "You must wait %d seconds, before installing another nitrous oxyde system.", PlayerData[playerid][pNosTime]);
	       	SendClientMessage(playerid, COLOR_GRAD1,string);
	    	return 1;
    	}
		
        if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 9.0))
            return	SendClientMessage(playerid, COLOR_GRAD1, "You must be near a vehicle to use this command.");
                
        if(PlayerData[playerid][pMaterials] < 799)
		    return	SendClientMessage(playerid, COLOR_GRAD1, "You do not have enough materials to install a nitrous oxyde system.");
			    
		if(IsInvalidNosVehicle(playerid))
		    return	SendClientMessage(playerid, COLOR_GRAD1, "NOS cannot be installed in this vehicle.");
			    
        if(level >= 0 && level < 50) { nostogive = 1009; }
        else if(level >= 50 && level < 100) { nostogive = 1009; }
        else if(level >= 100 && level < 200) { nostogive = 1008; }
        else if(level >= 200 && level < 400) { nostogive = 1008; }
        else if(level >= 400) { nostogive = 1010; }
				
        AddVehicleComponentEx(closestcar, nostogive, playerid);
        PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
        PlayerData[playerid][pMaterials] -= 800;
        format(string, sizeof(string), "* %s has added nitrous injection to their %s.", getPlayerName(playerid), VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400]);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        PlayerData[playerid][pNosTime] = 480;
		return 1;
    }
    else SendClientMessage(playerid, COLOR_GRAD1, "You cannot use this command as you're not a mechanic.");
    return 1;
}
Thanks in advance for anyone willing to help.
P.S: I have posted this on other forums and the people there sent me to how to add custom unknown commands messages, I do not require that as I already have it implemented, my issue is the fact that these commands forward the unknown command message instead of the set messages.
Reply
#2

So nobody has any idea why this doesn't work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)