Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(IsPlayerNPC(playerid)) return 1;
- if(playerDB[playerid][vedelogin] == false)
- {
- SendClientMessage(playerid,GREY,"* Serveris: Pirmiausia prisijunkite");
- return 1;
- }
- if(oldstate == PLAYER_STATE_DRIVER)
- {
- GameTextForPlayer(playerid," ",100,5);
- }
- if(newstate == PLAYER_STATE_DRIVER)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleDB[vehicleid][locked])
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- if(strcmp(name,vehicleDB[vehicleid][owner_name],true))
- {
- new msg[128];
- format(msg,sizeof(msg),"Mašinos savininkas {347C17}%s",vehicleDB[vehicleid][owner_name]);
- SendClientMessage(playerid,RED,msg);
- Stop(playerid);
- return 1;
- }
- if(!playerDB[playerid][rbool][0])
- {
- KickEx(playerid);
- }
- playerDB[playerid][rbool][0]=false;
- }
- new typ;
- typ = IsAutohausCar(vehicleid);
- if(typ!=-1)
- {
- new string[128];
- TogglePlayerControllable(playerid,0);
- Spectating[playerid][0]=typ;
- SetVehicleParamsForAll(vehicleid,0,1);
- SendClientMessage(playerid, COLOR_YELLOW, "~*~ Utenos naudotu auto turgus ~*~");
- format(string,128,"Pavadinimas: %s",Buylist[typ][Name]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string,128,"Kaina: $%i",Buylist[typ][Price]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string,128,"Atstatymo kaina: $%i",Buylist[typ][Repair]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SendClientMessage(playerid, COLOR_GREEN, "Nori sita pirkti?: /pirkti");
- SendClientMessage(playerid, COLOR_GREEN, "Nenori pirkti?: /islipti");
- SetTimerEx("removcar",5000,0,"i",playerid);
- SendClientMessage(playerid, COLOR_GREEN, "Apsispresti turesi per 5s.!!");
- /* new msg[256];
- format(msg,sizeof(msg),"~n~ ~r~Modelis:~y~ %s ~n~~r~Kaina: ~y~%i LT~n~~r~Remonto kaina:~y~ %i LT~n~Isigijimui rasykite ~w~/buycar~n~~r~Islipimui rasykite ~w~/exitcar",Buylist[typ][Name],Buylist[typ][Price],Buylist[typ][Repair]);
- GameTextForPlayer(playerid,msg,30000,3);*/
- }
- printf("%d %d", newstate, oldstate);
- if(beingspec[playerid])
- {
- if((oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) && (newstate != PLAYER_STATE_DRIVER && newstate != PLAYER_STATE_PASSENGER))
- {
- print("pasiektas player");
- PlayerSpectatePlayer( specid[ playerid ], playerid );
- }
- printf("%d %d", newstate, oldstate);
- else if( oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER )
- {
- print("pasiektas vehicle");
- PlayerSpectateVehicle( specid[ playerid ], GetPlayerVehicleID( playerid ) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement