08.09.2013, 18:07
Here's the ServerHeartbeatTwo timer, Konstantinos i scripter beginner plus on pawn so if you can tell me what's the problem here and explain me...
Код:
// Timer Name: ServerHeartbeatTwo() // TickRate: 1 secs. Timer:ServerHeartbeatTwo[1000]() { new Float:oldposx, Float:oldposy, Float:oldposz; foreach(Player, i) { if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][4] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 29); } if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && JetPack[i] == 0 && PlayerInfo[i][pAdmin] < 4) { new string[74 + MAX_PLAYER_NAME]; format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be jetpack hacking.", GetPlayerNameEx(i), i); ABroadCast( COLOR_YELLOW, string, 2 ); format(string, sizeof(string), "%s (ID %d) may possibly be jetpack hacking.", GetPlayerNameEx(i), i); Log("logs/hack.log", string); } if( IsPlayerInRangeOfPoint( i, 2, 1544.2, -1353.4, 329.4 ) ) { GivePlayerValidWeapon( i, 46, 9 ); } if(GetPlayerState(i) == PLAYER_STATE_ONFOOT) for(new h = 0; h < sizeof(FamilyInfo); h++) { if(IsPlayerInRangeOfPoint(i, 2.0, FamilyInfo[h][FamilySafe][0], FamilyInfo[h][FamilySafe][1], FamilyInfo[h][FamilySafe][2])) { if(FamilyInfo[h][FamilyUSafe] == 1) { GameTextForPlayer(i, "~y~gang safe~w~~n~Type ~r~/safehelp~w~ for more information", 5000, 3); } } } for(new h = 0; h < sizeof(Points); h++) { if(IsPlayerInRangeOfPoint(i, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz])) { if(Points[h][Type] == 1 && GetPVarInt(i, "Packages") == 0) { GameTextForPlayer(i, "~w~Type /getmats to purchase a ~n~~r~materials package", 5000, 5); } else if(Points[h][Type] == 3 && PlayerInfo[i][pPot] < 3) { GameTextForPlayer(i, "~w~Type /getseeds to purchase some ~r~pot seeds", 5000, 5); } else if(Points[h][Type] == 4) { GameTextForPlayer(i, "~w~Type /getcrack to purchase some ~r~crack", 5000, 5); } else if(Points[h][Type] == 5) { GameTextForPlayer(i, "~w~Type /getcrate to purchase a ~r~crate", 5000, 5); } } } if(SafeTime[i] > 0) { if(--SafeTime[i] == 1 && gPlayerAccount[i] == 1 && gPlayerLogged{i} == 0) { SendClientMessageEx(i, COLOR_WHITE, "HINT: You can now login by typing your password below."); } } if(PlayerInfo[i][pLocal] != 255 && PlayerInfo[i][pInt] != 0) { new house = PlayerInfo[i][pLocal]; GetPlayerPos(i, oldposx, oldposy, oldposz); if(oldposz != 0.0) { if(oldposz < 600.0) { if(house == 242) { SetPlayerInterior(i,0); SetPlayerPos(i,1073.0619,-344.5148,73.9922); PlayerInfo[i][pInt] = 0; PlayerInfo[i][pLocal] = 255; } } } } if(CellTime[i] > 0) { if (CellTime[i] == cchargetime) { CellTime[i] = 1; if(Mobile[Mobile[i]] == i) { CallCost[i] += callcost; } } CellTime[i]++; if (Mobile[Mobile[i]] == INVALID_PLAYER_ID && CellTime[i] == 5) { if(IsPlayerConnected(Mobile[i])) { new Float:rX, Float:rY, Float:rZ; GetPlayerPos(i, rX, rY, rZ); new string[18 + MAX_PLAYER_NAME]; format(string, sizeof(string), "* %s's phone rings.", GetPlayerNameEx(Mobile[i])); PlayerPlaySound(i, 1002, 0.0, 0.0, 0.0); RingTone[Mobile[i]] = 10; ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } if(CellTime[i] == 0 && CallCost[i] > 0) { new string[28]; format(string, sizeof(string), "~w~The call cost~n~~r~$%d",CallCost[i]); GivePlayerCash(i, -CallCost[i]); GameTextForPlayer(i, string, 5000, 1); CallCost[i] = 0; } if(TransportDriver[i] < 999) { if(GetPlayerVehicleID(i) != GetPlayerVehicleID(TransportDriver[i]) || !TransportDuty[TransportDriver[i]]) { if(IsPlayerConnected(TransportDriver[i])) { TransportMoney[TransportDriver[i]] += TransportCost[i]; TransportTime[TransportDriver[i]] = 0; TransportCost[TransportDriver[i]] = 0; new string[36]; format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[i]); GameTextForPlayer(TransportDriver[i], string, 5000, 1); TransportDriver[i] = 999; } } else if(TransportTime[i] >= 16) { TransportTime[i] = 1; if(TransportDriver[i] < 999) { if(IsPlayerConnected(TransportDriver[i])) { TransportCost[i] += TransportValue[TransportDriver[i]]; TransportCost[TransportDriver[i]] = TransportCost[i]; } } } TransportTime[i] += 1; new string[24]; format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]); GameTextForPlayer(i, string, 15000, 6); if(TransportCost[i] > GetPlayerCash(i)) { RemovePlayerFromVehicle(i); new Float:slx, Float:sly, Float:slz; GetPlayerPos(i, slx, sly, slz); SetPlayerPos(i, slx, sly, slz + 2); GameTextForPlayer(i, "~r~You're flat out of cash!", 4000, 4); } } if(GetPVarInt(i, "rccam") == 0) { if(GetVehicleModel(GetPlayerVehicleID(i)) != 594) { DestroyVehicle(GetPVarInt(i, "rcveh")); KillTimer(GetPVarInt(i, "rccamtimer")); } } } }