06.10.2014, 15:44
Hello, so i want my server save automatically, at the momen i have to type /saveserver, but i want if i restart smth then it save automatically
//
And the second problem is the car engine.
Now i have to type /mootor, but i want if i press 2 then engine starts
I really hope you understand me, beacause my englis suck..
//
And the second problem is the car engine.
Now i have to type /mootor, but i want if i press 2 then engine starts
Код:
COMMAND:mootor(playerid, params[]) { new string[128]; if(PlayerLoggedIn[playerid] == true) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new vehicleid = GetPlayerVehicleID(playerid); if(!IsABike(vehicleid)) { if(Mootor[vehicleid] == 0) { if(IsAnyFactionVehicle(vehicleid)) { if(IsFactionVehicle(vehicleid, KasutajaInfo[playerid][Grupeering])) { if(K2ivitabMootorit[playerid] == 0) { format(string, sizeof(string), "* %s kдivitab sхiduki mootori.", RPN(playerid)); SendEmotion(playerid, string); SetTimerEx("StartVehicleEngine", 0, false, "i i", playerid, vehicleid); K2ivitabMootorit[playerid] = 1; } else SendClientMessage(playerid, COLOR_WHITE, "Palun oota ennem jдrgmise mootori kдivitamist"); } else SendClientMessage(playerid, COLOR_RED, "See pole sinu masin!"); } else if(IsAnyJobVehicle(vehicleid)) { if(IsJobVehicle(vehicleid, KasutajaInfo[playerid][Tookoht])) { if(K2ivitabMootorit[playerid] == 0) { format(string, sizeof(string), "* %s kдivitab sхiduki mootori.", RPN(playerid)); SendEmotion(playerid, string); SetTimerEx("StartVehicleEngine", 0, false, "i i", playerid, vehicleid); K2ivitabMootorit[playerid] = 1; } else SendClientMessage(playerid, COLOR_WHITE, "Palun oota ennem jдrgmise mootori kaivitamist"); } else SendClientMessage(playerid, COLOR_RED, "See pole sinu masin!"); } else if(!IsAnyFactionVehicle(vehicleid) && !IsAnyJobVehicle(vehicleid)) { if(MasinaInfo[vehicleid-FraksiMasinaidKokku][MasinOlemas] == 1) { if(!strcmp(MasinaInfo[vehicleid-FraksiMasinaidKokku][Omanik], RPNU(playerid), true)) { if(K2ivitabMootorit[playerid] == 0) { format(string, sizeof(string), "* %s kдivitab sхiduki mootor.", RPN(playerid)); SendEmotion(playerid, string); SetTimerEx("StartVehicleEngine", 0, false, "i i", playerid, vehicleid); K2ivitabMootorit[playerid] = 1; } else SendClientMessage(playerid, COLOR_WHITE, "Palun oota ennem jдrgmise mootori kaivitamist"); } /*else if(!strcmp(MasinaInfo[vehicleid-FraksiMasinaidKokku][VaruOmanik], RPNU(playerid), true)) { if(K2ivitabMootorit[playerid] == 0) { format(string, sizeof(string), "* %s keerab oma masina varuvхtit ja ьritab kдivitada masina mootorit.", RPN(playerid)); SendEmotion(playerid, string); SetTimerEx("StartVehicleEngine", 1500, false, "i i", playerid, vehicleid); K2ivitabMootorit[playerid] = 1; } else SendClientMessage(playerid, COLOR_GREY, "Palun oota ennem jдrgmise mootori kдivitamist!"); }*/ else SendClientMessage(playerid, COLOR_RED, "See pole sinu masin!"); } } } else if(Mootor[vehicleid] == 1) { new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); Mootor[vehicleid] = 0; format(string, sizeof(string), "* %s suretab sхiduki mootori.", RPN(playerid)); SendEmotion(playerid, string); SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective); } } else SendClientMessage(playerid, COLOR_WHITE, "VIGA: Jalgratastel pole mootorit"); } else SendClientMessage(playerid, COLOR_WHITE, "VIGA: Sa ei ole masina juht"); } else SendClientMessage(playerid, COLOR_WHITE, "VIGA: Sa pead olema mingis masinas"); } else SendClientMessage(playerid, COLOR_WHITE, "VIGA: Sa ei ole veel sisse loginud"); return 1; }