[Question] How to fix samp zcmd commands not working - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: open.mp (https://forum.open.mp/forumdisplay.php?fid=40) --- Forum: Questions and Suggestions (https://forum.open.mp/forumdisplay.php?fid=42) --- Thread: [Question] How to fix samp zcmd commands not working (/showthread.php?tid=2563) |
How to fix samp zcmd commands not working - angelovj8 - 2024-01-20 How to fix samp zcmd commands not working RE: How to fix samp zcmd commands not working - Mido - 2024-01-22 Describe the issue? RE: How to fix samp zcmd commands not working - angelovj8 - 2024-01-22 There are no errors or warnings in the compiler but the commands are not working in game RE: How to fix samp zcmd commands not working - Mido - 2024-01-23 Again, post the errors or warnings. We cannot keep guessing... RE: How to fix samp zcmd commands not working - angelovj8 - 2024-01-24 C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(42) : warning 213: tag mismatch C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(42) : warning 213: tag mismatch C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(42) : warning 213: tag mismatch C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(43) : warning 213: tag mismatch C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(43) : warning 213: tag mismatch C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(43) : warning 213: tag mismatch C:\Users\Jordan\Desktop\New folder\filterscripts\koli.pwn(46) : warning 217: loose indentation Pawn compiler 3.10.4 Copyright © 1997-2006, ITB CompuPhase Header size: 1260 bytes Code size: 19184 bytes Data size: 334468 bytes Stack/heap size: 16384 bytes; estimated max. usage=39 cells (156 bytes) Total requirements: 371296 bytes 7 Warnings. RE: How to fix samp zcmd commands not working - angelovj8 - 2024-01-24 #define FILTERSCRIPT #include <a_samp> #include <izcmd> #include <sscanf2> native IsValidVehicle(vehicleid); enum vehicle_data { vehicle_plate[32], vehicle_engine, vehicle_lights, vehicle_alarm, vehicle_locked, vehicle_bonnet, vehicle_boot, vehicle_objective } new VehicleData[MAX_VEHICLES][vehicle_data]; stock IsVehicleBicycle(vehicleid) { if(GetVehicleModel(vehicleid)==381 || GetVehicleModel(vehicleid)==509 ||GetVehicleModel(vehicleid)==510)return 1; return 0; } stock SetVehicleParamsForAll(vehicleid, objective, doorslocked) { for(new i = 0; i < MAX_PLAYERS; i++) { SetVehicleParamsForPlayer(vehicleid, i, objective, doorslocked); } return 1; } stock GetNearestVehicle(playerid) { for(new i = 0; i < MAX_VEHICLES; i++) { if(IsValidVehicle(i)) { new float:pos[3]; GetVehiclePos(i, pos[0],pos[1],pos[2]); if(IsPlayerInRangeOfPoint(playerid,5.0,pos[0],pos[1],pos[2]))return i; } } return INVALID_VEHICLE_ID; } public OnFilterScriptInit() { for(new v = 0; v < MAX_VEHICLES; v++) { VehicleData[v][vehicle_engine]=VEHICLE_PARAMS_OFF; VehicleData[v][vehicle_lights]=VEHICLE_PARAMS_OFF; VehicleData[v][vehicle_alarm]=VEHICLE_PARAMS_OFF; VehicleData[v][vehicle_locked]=VEHICLE_PARAMS_OFF; VehicleData[v][vehicle_bonnet]=VEHICLE_PARAMS_OFF; VehicleData[v][vehicle_boot]=VEHICLE_PARAMS_OFF; VehicleData[v][vehicle_objective]=VEHICLE_PARAMS_OFF; if(IsVehicleBicycle(v)) { VehicleData[v][vehicle_engine]=VEHICLE_PARAMS_ON; } SetVehicleParamsEx(v,VehicleData[v][vehicle_engine],VehicleData[v][vehicle_lights],VehicleData[v][vehicle_alarm],VehicleData[v][vehicle_locked],VehicleData[v][vehicle_bonnet],VehicleData[v][vehicle_boot],VehicleData[v][vehicle_objective]); } return 1; } public OnVehicleStreamIn(vehicleid,forplayerid) { SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine], VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); SetVehicleParamsForAll(vehicleid, VehicleData[vehicleid][vehicle_objective],VehicleData[vehicleid][vehicle_locked]); } COMMAND:engine(playerid,params[]) { if(!IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1 ,"Only driver can start engine"); new vehicleid = GetPlayerVehicleID(playerid); if(VehicleData[vehicleid][vehicle_engine] == VEHICLE_PARAMS_OFF) { VehicleData[vehicleid][vehicle_engine] = VEHICLE_PARAMS_ON; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); return GameTextForPlayer(playerid,"~g~Engine: On", 3000, 5); } else { VehicleData[vehicleid][vehicle_engine] = VEHICLE_PARAMS_OFF; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); GameTextForPlayer(playerid,"~r~Engine: Off", 3000, 5); } return 1; } COMMAND:lights(playerid,params[]) { if(!IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1 ,"Only driver can turn on lights"); new vehicleid = GetPlayerVehicleID(playerid); if(VehicleData[vehicleid][vehicle_lights] == VEHICLE_PARAMS_OFF) { VehicleData[vehicleid][vehicle_lights] = VEHICLE_PARAMS_ON; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); return GameTextForPlayer(playerid,"~g~Lights: On", 3000, 5); } else { VehicleData[vehicleid][vehicle_lights] = VEHICLE_PARAMS_OFF; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); GameTextForPlayer(playerid,"~r~Lights: Off", 3000, 5); } return 1; } COMMAND:alarm(playerid,params[]) { new vehicleid = GetNearestVehicle(playerid); if(vehicleid == INVALID_VEHICLE_ID)return SendClientMessage(playerid, -1, "There are no vehicles nearby to toggle the alram for."); if(VehicleData[vehicleid][vehicle_alarm] == VEHICLE_PARAMS_OFF) { VehicleData[vehicleid][vehicle_alarm] = VEHICLE_PARAMS_ON; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); return GameTextForPlayer(playerid,"~g~Alarm: On", 3000, 5); } else { VehicleData[vehicleid][vehicle_alarm] = VEHICLE_PARAMS_OFF; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); GameTextForPlayer(playerid,"~r~Alarm: Off", 3000, 5); } return 1; } COMMAND:bonnet(playerid,params[]) { new vehicleid = GetNearestVehicle(playerid); if(vehicleid == INVALID_VEHICLE_ID)return SendClientMessage(playerid, -1, "There are no vehicles nearby to open the bonet for"); if(VehicleData[vehicleid][vehicle_bonnet] == VEHICLE_PARAMS_OFF) { VehicleData[vehicleid][vehicle_bonnet] = VEHICLE_PARAMS_ON; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); return GameTextForPlayer(playerid,"~g~Bonnet: Open", 3000, 5); } else { VehicleData[vehicleid][vehicle_bonnet] = VEHICLE_PARAMS_OFF; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); GameTextForPlayer(playerid,"~r~Bonnet: Closed", 3000, 5); } return 1; } COMMAND:boot(playerid,params[]) { new vehicleid = GetNearestVehicle(playerid); if(vehicleid == INVALID_VEHICLE_ID)return SendClientMessage(playerid, -1, "There are no vehicles nearby to open the boot for"); if(VehicleData[vehicleid][vehicle_boot] == VEHICLE_PARAMS_OFF) { VehicleData[vehicleid][vehicle_boot] = VEHICLE_PARAMS_ON; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); return GameTextForPlayer(playerid,"~g~boot: Open", 3000, 5); } else { VehicleData[vehicleid][vehicle_boot] = VEHICLE_PARAMS_OFF; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); GameTextForPlayer(playerid,"~r~boot: Closed", 3000, 5); } return 1; } COMMAND:lock(playerid,params[]) { new vehicleid = GetNearestVehicle(playerid); if(vehicleid == INVALID_VEHICLE_ID)return SendClientMessage(playerid, -1, "There are no vehicles nearby to open the boot for"); if(VehicleData[vehicleid][vehicle_boot] == VEHICLE_PARAMS_OFF) { VehicleData[vehicleid][vehicle_boot] = VEHICLE_PARAMS_ON; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); SetVehicleParamsForAll(vehicleid,VehicleData[vehicleid][vehicle_objective],VehicleData[vehicleid][vehicle_locked]); return GameTextForPlayer(playerid,"~g~Lock: Open", 3000, 5); } else { VehicleData[vehicleid][vehicle_boot] = VEHICLE_PARAMS_OFF; SetVehicleParamsEx(vehicleid,VehicleData[vehicleid][vehicle_engine],VehicleData[vehicleid][vehicle_lights],VehicleData[vehicleid][vehicle_alarm],VehicleData[vehicleid][vehicle_locked],VehicleData[vehicleid][vehicle_bonnet],VehicleData[vehicleid][vehicle_boot],VehicleData[vehicleid][vehicle_objective]); SetVehicleParamsForAll(vehicleid,VehicleData[vehicleid][vehicle_objective],VehicleData[vehicleid][vehicle_locked]); GameTextForPlayer(playerid,"~r~Lock: Closed", 3000, 5); } return 1; } |