Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tal332255 - Tal Peretz סקריפט זה הוכן על ידי המתכנת
- #include <a_samp>
- #include <Dini>
- #include <dudb>
- #pragma tabsize 0
- #define orange 0xFF9900AA
- #define red 0xFF0000AA
- #define yellow 0xFFFF00AA
- new bool:FALSE = false;
- #define SendClientMessageString(%0,%1,%2,%3) do{new _string[128]; format(_string,sizeof(_string),%2,%3); SendClientMessage(%0,%1,_string);} while(FALSE)
- new CarFullHealth[MAX_VEHICLES],TimerPlayerInCar[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("Survey By tal332255 - Tal Peretz");
- SetTimer("SetNumsCars",3000,0);
- return 1;
- }
- forward SetNumsCars();
- public SetNumsCars()
- {
- new MAXCAR = CreateVehicle(411,0,0,0,0,0,0,-1);
- DestroyVehicle(MAXCAR);
- for (new car=1; car < MAXCAR; car++)
- CarFullHealth[car] = 1;
- return 1;
- }
- public OnPlayerStateChange(playerid,newstate,oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER) TimerPlayerInCar[playerid] = SetTimerEx("CheckPlayerInCar",1000,1,"%d",playerid);
- if(oldstate == PLAYER_STATE_DRIVER) KillTimer(TimerPlayerInCar[playerid]);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- CarFullHealth[vehicleid] = 1;
- return 1;
- }
- forward CheckPlayerInCar(playerid);
- public CheckPlayerInCar(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return KillTimer(TimerPlayerInCar[playerid]);
- new vehicleid = GetPlayerVehicleID(playerid),Float:health;
- GetVehicleHealth(vehicleid, health);
- if(CarFullHealth[vehicleid] == 1 && health < 1000) return CarFullHealth[vehicleid] = 0;
- if(CarFullHealth[vehicleid] == 0 && health == 1000)
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- if(IsPlayerConnected(i) && IsPlayerXAdmin(i))
- SendClientMessageString(i,yellow, ".עם חשש לצ'יט תיקון רכב %s (Id: %d)",GetName(playerid),playerid);
- CarFullHealth[vehicleid] = 1;
- return 1;
- }
- return 1;
- }
- forward RepairVehicleEx(vehicleid);
- public RepairVehicleEx(vehicleid)
- {
- CarFullHealth[vehicleid] = 1;
- RepairVehicle(vehicleid);
- return 1;
- }
- forward SetVehicleHealthEx(vehicleid, Float:health);
- public SetVehicleHealthEx(vehicleid, Float:health)
- {
- if(health == 1000) CarFullHealth[vehicleid] = 1;
- SetVehicleHealth(vehicleid, health);
- return 1;
- }
- ///////
- stock IsPlayerXAdmin(playerid){
- new playername[24],file[64];
- GetPlayerName(playerid, playername, 24);
- format(file,64,"xap/Users/%s.ini",udb_encode(playername));
- if(dini_Int(file,"Level") >= 1 && dini_Int(file,"LoggedIn") == 1) return true;
- else return false;}
- stock GetName(playerid){
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Name,sizeof(Name));
- return Name;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement