Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // w OnGameModeInit:
- SetTimer("Update", 150, true);
- SetTimer("OnSecondTimer", 1000, true);
- // na górze mapy, dawałem też bez MAX_PLAYERS i też nie działało jak trzeba:
- new FleshFoto[MAX_PLAYERS] = 0;
- new ViaBlip[MAX_PLAYERS] =;
- public Update()
- {
- static Float:vhealth, Float:VehidHealth, string[256], string2[256];
- Loop(i, GetMaxPlayers())
- {
- Loop(photoid, MAX_PHOTO_RADARS)
- {
- if(PhotoRadar[photoid][pUID])
- {
- if(IsPlayerInRangeOfPoint(i, 8.0, PhotoRadar[photoid][pPosX], PhotoRadar[photoid][pPosY], PhotoRadar[photoid][pPosZ]))
- {
- if(speed > PhotoRadar[photoid][pMaxSpeed] && GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- if(!GetPVarInt(i, "Fotoradar"))
- {
- TextDrawShowForPlayer(i, FleshText[i]);
- FleshFoto[i] = 2; // tutaj ustawiam sekundy po jakim zniknie textdraw 'FleshText' (tutaj 2 sekundy)
- SetPVarInt(i, "Fotoradar", 1);
- }
- }
- }
- }
- Loop(viaid, MAX_VIA)
- {
- if(!GetPVarInt(i, "via"))
- {
- if(IsPlayerInRangeOfPoint(i, 5.0, via[viaid][vPosX], via[viaid][vPosY], via[viaid][vPosZ]))
- {
- if(GetPlayerState(i) == PLAYER_STATE_DRIVER && PlayerVehicleIsTruck(i))
- {
- TextDrawShowForPlayer(i, toll[i]);
- SetPVarInt(i, "via", 1);
- ViaBlip[i] = 5; // tutaj ustawiam po jakim czasie zniknie textdraw 'toll' (5 sekund)
- }
- }
- }
- }
- }
- return 1;
- }
- // teraz te czasy ustawione w publicu Update zeruje w publicu OnSecondTimer odświeżającym się co sekundę:
- public OnSecondTimer()
- {
- Loop(i, GetMaxPlayers())
- {
- if(FleshFoto[i])
- {
- if(GetPVarInt(i, "Fotoradar") == 1)
- {
- FleshFoto[i] --;
- if(FleshFoto[i] <= 0)
- {
- TextDrawHideForPlayer(i, FleshText[i]);
- DeletePVar(i, "Fotoradar");
- }
- }
- }
- if(ViaBlip[i])
- {
- if(GetPVarInt(i, "via") == 1)
- {
- iaBlip[i]--;
- if(ViaBlip[i] <= 0)
- {
- TextDrawHideForPlayer(i, toll[i]);
- DeletePVar(i, "via");
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement