#include <a_samp>#include <zcmd>new kocsi;new ELSOKOCSIID;new UTOLSOKOCSIID;forward BerlesVege(playerid, kocsi);CMD:berles(playerid, params[]){ if(!BerlosKocsi(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, -1, \"Nem ülsz bérlõs kocsiban!\"); if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, \"A bérlés ára 1500$!\") return TogglePlayerControllable(playerid,0); SetTimerEx(\"BerlesVege\", 60*1000*20, false, \"ii\", playerid, kocsi); return SendClientMessage(playerid, -1, \"Jármû kibérelve! -1500$, 20 percig érvényes!\") return TogglePlayerControllable(playerid,1);}stock BerlosKocsi(v){ if(v >= ELSOKOCSIID && v <= UTOLSOKOCSIID) return 1; return 0;}public BerlesVege(playerid){ SendClientMessage(playerid, -1, \"Lejárt a bérlési idõ!\"); SetVehicleToRespawn(kocsi);}
stock BerlosKocsi(v){ if(v >= 8 && v <= 18) return 1; return 0;}
#include <a_samp>#include <zcmd>new kocsi;new ELSOKOCSIID;new UTOLSOKOCSIID;forward BerlesVege(playerid, kocsi);CMD:berles(playerid, params[]){ if(!BerlosKocsi(GetPlayerVehicleID(playerid))) if(RemovePlayerFromVehicle(playerid)) return SendClientMessage(playerid,-1,\"Nem bérelted ki a kocsit!\"); if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, \"A bérlés ára 1500$!\"); SetTimerEx(\"BerlesVege\", 60*1000*20, false, \"ii\", playerid, kocsi); return SendClientMessage(playerid, -1, \"Jármû kibérelve! -1500$, 20 percig érvényes!\");}stock BerlosKocsi(v){ if(v >= ELSOKOCSIID && v <= UTOLSOKOCSIID) return 1; return 0;}public BerlesVege(playerid){ SendClientMessage(playerid, -1, \"Lejárt a bérlési idõ!\"); SetVehicleToRespawn(kocsi); RemovePlayerFromVehicle(playerid);}
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
De ne a modba tedd bele hanem FS -ként!
#include <a_samp>#include <zcmd>new kocsi;forward BerlesVege(playerid, kocsi);CMD:berles(playerid, params[]){ if(GetPlayerMoney(playerid) <= 1500) { if(!BerlosKocsi(GetPlayerVehicleID(playerid))) if(RemovePlayerFromVehicle(playerid)) return SendClientMessage(playerid,-1,\"Nem bérelted ki a kocsit!\"); if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, \"A bérlés ára 1500$!\"); SetTimerEx(\"BerlesVege\", 60*1000*20, false, \"ii\", playerid, kocsi); GivePlayerMoney(playerid, -1500); SendClientMessage(playerid, -1, \"Jármû kibérelve! -1500$, 20 percig érvényes!\"); } else { SendClientMessage(playerid, -1, \"Nincs $1500-od!\"); }}stock BerlosKocsi(v){ if(v >= 8 && v <= 18) return 1; return 0;}public BerlesVege(playerid){ SendClientMessage(playerid, -1, \"Lejárt a bérlési idõ!\"); SetVehicleToRespawn(kocsi); RemovePlayerFromVehicle(playerid);}
#include <a_samp>#include <zcmd>forward BerlesVege(playerid, kocsi);public OnGameModeInit(){ new x = 8-1; for(; x++ < 18;) MotorAllitas(x); return 1;}CMD:berles(playerid, params[]){ if(!BerlosKocsi(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, -1, \"Nem ülsz bérlõs kocsiban!\"); if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, \"A bérlés ára 1500$!\"); SetTimerEx(\"BerlesVege\", 60*1000*20, false, \"ii\", playerid, GetPlayerVehicleID(playerid)); MotorInditas(GetPlayerVehicleID(playerid)); return SendClientMessage(playerid, -1, \"Jármû kibérelve! -1500$, 20 percig érvényes!\");}stock BerlosKocsi(v){ if(v >= 8 && v <= 18) return 1; return 0;}public BerlesVege(playerid, kocsi){ SendClientMessage(playerid, -1, \"Lejárt a bérlési idõ!\"); SetVehicleToRespawn(kocsi); MotorAllitas(kocsi);}stock MotorAllitas(vehicleid){new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); return 1;}stock MotorInditas(vehicleid){new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective); return 1;}
Itt az egész hibátlanul, megcsinálva ahogy kérted: #include <a_samp>#include <zcmd>forward BerlesVege(playerid, kocsi);public OnGameModeInit(){ new x = 8-1; for(; x++ < 18;) MotorAllitas(x); return 1;}CMD:berles(playerid, params[]){ if(!BerlosKocsi(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, -1, \"Nem ülsz bérlõs kocsiban!\"); if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, \"A bérlés ára 1500$!\"); SetTimerEx(\"BerlesVege\", 60*1000*20, false, \"ii\", playerid, GetPlayerVehicleID(playerid)); MotorInditas(GetPlayerVehicleID(playerid)); return SendClientMessage(playerid, -1, \"Jármû kibérelve! -1500$, 20 percig érvényes!\");}stock BerlosKocsi(v){ if(v >= 8 && v <= 18) return 1; return 0;}public BerlesVege(playerid, kocsi){ SendClientMessage(playerid, -1, \"Lejárt a bérlési idõ!\"); SetVehicleToRespawn(kocsi); MotorAllitas(kocsi);}stock MotorAllitas(vehicleid){new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); return 1;}stock MotorInditas(vehicleid){new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective); return 1;}
SetPlayerMoney((GetPlayerMoney(playerid)-1500)