Clarisa123 Posted May 25, 2015 Report Share Posted May 25, 2015 (edited) Salutare, la pronirea masini trebuie sa scriu /engine, vreau sa modific /engine in apasarea tastei "2"if(strcmp(cmd, "/engine", true) == 0)La fel vreau sa fac si cu /enter , sa nu mai scriu /enter doar sa apas tasta F.La fel si cu /lights , vreau sa se aprinda farurile pe tasta CTRL.Cum ar trebui sa modific linia?Multumesc frumos ! Edited May 25, 2015 by Clarisa123 Quote Link to comment Share on other sites More sharing options...
0 FratziWear Posted May 25, 2015 Report Share Posted May 25, 2015 Buna ziua,Chestia asta se face la:OnPlayerKeyStateChangeDefinesti ceva de genul:#define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))Apoi la OnPlayerKeyStateChange pui ceva de genul: if(PRESSED(KEY_SUBMISSION)) { new engine, lights, alarm, doors, bonnet, boot, objective; if(IsPlayerInAnyVehicle(playerid)) { new veh = GetPlayerVehicleID(playerid); if(veh != INVALID_VEHICLE_ID) { if(EngineStatus[veh] == 0 && (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)) { GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(veh, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); EngineStatus[veh] = 1; SendClientMessage(playerid, COLOR_GREY, "* You started the Engine."); } else if(EngineStatus[veh] == 1 && (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)) { GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(veh, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective); EngineStatus[veh] = 0; SendClientMessage(playerid, COLOR_GREY, "You stopped the Engine."); } } } }Si cam asta a fost pentru a porni motorul pe tasta 2.P.S: Asta e doar un exemplu, iti definesti tu cum vrei STRING-uri s.a.m.d.P.P.S: Tot ceva de genul este si la lumini.Spor iti doresc.Cu stima si respect,FratziWearModerator Scripting @SA-MP.ro 1 Quote Link to comment Share on other sites More sharing options...
Question
Clarisa123
Salutare, la pronirea masini trebuie sa scriu /engine, vreau sa modific /engine in apasarea tastei "2"
La fel vreau sa fac si cu /enter , sa nu mai scriu /enter doar sa apas tasta F.
La fel si cu /lights , vreau sa se aprinda farurile pe tasta CTRL.
Cum ar trebui sa modific linia?
Multumesc frumos !
Edited by Clarisa123Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.