Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- //Author: Armando Alves (DoDo)
- new VeiculoBugado[MAX_VEHICLES];
- stock VerificarVeiculoCrashado(playerid, id)
- {
- if(!VeiculoBugado[id])
- {
- VeiculoBugado[id] = id;
- new Float:Pos[3];
- for(new i; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- if(GetPlayerVehicleID(i) == VeiculoBugado[id])
- {
- if(Pos[0] >= 999999.875000 || Pos[1] >= 10000000.000000 || Pos[2] >= 1410065408.000000)
- {
- CrashadoVeiculo(i);
- }
- else
- {
- CrashouVeiculo(i);
- }
- }
- }
- }
- VeiculoBugado[id] = -1;
- }
- }
- stock CrashadoVeiculo(i)
- {
- GameTextForPlayer(i, "Retornando a tela inicial", 10000, 5);
- SetPlayerPos(i, 0.0, 0.0, 0.0);
- SpawnPlayer(i);
- }
- stock CrashouVeiculo(i)
- {
- Ban(i);
- }
- public OnPlayerUpdate(playerid)
- {
- new Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(pos[0] >= 10000000.000000 || pos[1] >= 10000000.000000 || pos[2] >= 1410065408.000000)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- VerificarVeiculoCrashado(playerid, GetPlayerVehicleID(playerid));
- }
- GameTextForPlayer(playerid, "Retornando a tela inicial", 10000, 5);
- SetPlayerPos(playerid, 0.0, 0.0, 0.0);
- SpawnPlayer(playerid);
- }
- return 0x01;
- }
Advertisement
Add Comment
Please, Sign In to add comment