Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward OtherTimer();
- public OtherTimer()
- {
- new Float:maxspeed = 175.0;
- new plname[MAX_PLAYER_NAME];
- new string[256];
- new Float:oldposx, Float:oldposy, Float:oldposz;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (GetPlayerState(i) == 1) CheckForWalkingTeleport(i); // IF THE PLAYER IS IN A TELEPORT ZONE, TELEPORT THEM
- new vehicleid = GetPlayerVehicleID(i);
- if(SafeTime[i] > 0)
- {
- SafeTime[i]--;
- }
- if(SafeTime[i] == 1)
- {
- if(gPlayerAccount[i] == 1 && gPlayerLogged[i] == 0)
- {
- new loginname[64];
- new loginstring[128];
- GetPlayerName(i,loginname,64);
- format(loginstring,sizeof(loginstring),"Sveicinats GameWorld Role Play %s\nSis vards ir registrets.\nTev ir 30 sekundes laika lai, ielogotos:",loginname);
- ShowPlayerDialog(i,12346,DIALOG_STYLE_INPUT,"Ielogosanas panelis",loginstring,"Ielogoties","Iziet");
- }
- }
- if(GetPlayerState(i) == 2)
- {
- GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
- if(TelePos[i][5] > 550.0)
- {
- TelePos[i][0] = 0.0;
- TelePos[i][1] = 0.0;
- }
- if(TelePos[i][0] != 0.0)
- {
- new Float:xdist = TelePos[i][3]-TelePos[i][0];
- new Float:ydist = TelePos[i][4]-TelePos[i][1];
- new Float:sqxdist = xdist*xdist;
- new Float:sqydist = ydist*ydist;
- new Float:distance = (sqxdist+sqydist)/31;
- if ((BusrouteEast[i][0] == 0 && BusrouteWest[i][0] == 0))
- {
- if(gSpeedo[i] == 2)
- {
- if(distance <10)
- {
- format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~km/h : ~w~%.0f",distance);
- }
- if(distance > 10 && distance < 100)
- {
- format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~km/h : ~w~%.0f",distance);
- }
- if(distance > 100)
- {
- format(string, 256, "~n~~n~~n~~n~~n~~n~~n~~g~km/h : ~w~%.0f",distance);
- }
- GameTextForPlayer(i, string, 2000, 5);
- }
- if(distance > maxspeed && PlayerInfo[i][pAdmin] < 1)
- {
- new tmpcar = GetPlayerVehicleID(i);
- if(!IsAPlane(tmpcar))
- {
- GetPlayerName(i, plname, sizeof(plname));
- format(string, 256, "AdmWarning: [%d]%s %.0f km/h",i,plname,distance);
- ABroadCast(COLOR_YELLOW,string,1);
- }
- }
- }
- }
- if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
- {
- TelePos[i][0] = TelePos[i][3];
- TelePos[i][1] = TelePos[i][4];
- }
- }
- if(PlayerInfo[i][pLocal] != 255 && PlayerInfo[i][pInt] != 0)
- {
- GetPlayerPos(i, oldposx, oldposy, oldposz);
- if(oldposz != 0.0)
- {
- if(oldposz < 600.0)
- {
- /*if(house > 10000)
- {
- new tmpcar = GetPlayerVehicleID(i);
- if (!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && house == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && house == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && house == 10003)
- {
- if (GetPlayerState(i) == 2)
- {
- SetVehiclePos(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
- SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]);
- }
- else
- {
- SetPlayerPos(i, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
- }
- new oldcash = gSpentCash[i];
- new Total = GetPlayerMoney(i) - oldcash;
- printf("Total %d = GetPlayerMoney(playerid) %d - oldcash %d",Total,GetPlayerMoney(i),oldcash);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(i, name, sizeof(name));
- format(string,128,"<< %s has left the homemodshop with $%d >>",name,Total);
- PayLog(string);
- gSpentCash[i] = 0;
- TelePos[i][0] = 0.0;
- TelePos[i][1] = 0.0;
- PlayerInfo[i][pLocal] = 255;
- SetPlayerInterior(i,0);
- PlayerInfo[i][pInt] = 0;
- Spectate[i] = 255;
- }
- }*/
- }
- }
- }
- if(CellTime[i] > 0)
- {
- if (CellTime[i] == cchargetime)
- {
- CellTime[i] = 1;
- if(Mobile[Mobile[i]] == i)
- {
- CallCost[i] = CallCost[i]+callcost;
- }
- }
- CellTime[i] = CellTime[i] +1;
- if (Mobile[Mobile[i]] == 255 && CellTime[i] == 5)
- {
- if(IsPlayerConnected(Mobile[i]))
- {
- new called[MAX_PLAYER_NAME];
- GetPlayerName(Mobile[i], called, sizeof(called));
- format(string, sizeof(string), "* %s'am zvana telefons *dzin* *dzin* *dzin*.", called);
- 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)
- {
- format(string, sizeof(string), "~w~Zvans maksa~n~~r~$%d",CallCost[i]);
- SafeGivePlayerMoney(i, -CallCost[i]);
- GameTextForPlayer(i, string, 5000, 1);
- CallCost[i] = 0;
- }
- if(TransportTime[i] > 0)
- {//Taxi driver and passenger only
- 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;
- format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[i],TransportCost[i]);
- GameTextForPlayer(i, string, 15000, 6);
- }
- if (BusrouteEast[i][0] != 0 || BusrouteWest[i][0] != 0)
- {
- if (!IsPlayerInAnyVehicle(i) || !IsABus(GetPlayerVehicleID(i)))
- if (vehicleid != 0)
- {
- if (!IsABus(vehicleid))
- {
- if (BusrouteEast[i][0] != 0) BusrouteEnd(i, BusrouteEast[i][1]);
- else if (BusrouteWest[i][0] != 0) BusrouteEnd(i, BusrouteWest[i][1]);
- }
- }
- else
- {
- if (BusrouteEast[i][0] != 0) BusrouteEnd(i, BusrouteEast[i][1]);
- else if (BusrouteWest[i][0] != 0) BusrouteEnd(i, BusrouteWest[i][1]);
- }
- }
- if (IsABus(vehicleid) && GetPlayerState(i) == 2 && PlayerInfo[i][pJob] != 14)
- {
- SetVehicleToRespawn(vehicleid);
- }
- }
- }
- return 1;
- }
- othtimer = SetTimer("OtherTimer", 1000, true); // this was under GameModeInit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement