23.06.2014, 04:44
Quote:
tipo , eu achei um assim , mais ta todo bugado.
https://sampforum.blast.hk/showthread.php?tid=434739 |
tem algumas coordenadas de balanзa que tinha em meu gamemode sу mudar
pawn Код:
//ongamemodeinit
SetTimer("DonSpeed", 300, true);
pawn Код:
#include a_samp
#define MAX_BALANCE 6//espera ai
new Float:Balanca[MAX_BALANCE][7]={
{1609.6383,34.2066,37.3781},
{1624.3397,39.0709,37.0708},
{-1642.5553,-1624.5934,36.3355},
{-1640.2782,-1629.9591,36.3355},
{-647.2451,654.0349,16.8004},
{-643.4390,664.4327,16.8002}
};
new bool:DCheck[MAX_PLAYERS] = false;
forward DonSpeed();
public DonSpeed()
{
//for(new playerid = 0, players = MAX_PLAYERS; playerid != players; ++playerid)
for (new g; g < MAX_PLAYERS; g++)
{
if (GetPlayerVehicleSeat(g) == 0)
{
switch (GetVehicleModel(GetPlayerVehicleID(g)))
{
case VehicleFlatbed, VehicleDFT30, VehicleCementTruck, VehicleLineRunner, VehicleTanker, VehicleRoadTrain:
//if(!IsPlayerInAnyVehicle(g))return 1;
for(new i; i < MAX_BALANCE; i++)
{
if(IsPlayerInRangeOfPoint(g, 3.0, Balanca[i][0], Balanca[i][1], Balanca[i][2]) && DCheck[g] == false)
{
DCheck[g] = true;
SetTimerEx("DCongelar", 1000*10, false, "i", g);
TogglePlayerControllable(g, 0);
GameTextForPlayer(g, "~g~Pesando...", 3000, 3);
break;
}
}
}
}
}
return 1;
}
forward DCongelar(playerid);
public DCongelar(playerid)
{
TogglePlayerControllable(playerid, 1);
if(APlayerData[playerid][Overloaded] != false && DCheck[playerid] == true)
{
new DS[80], DName[MAX_PLAYER_NAME];GetPlayerName(playerid, DName, sizeof(DName));
format(DS,sizeof(DS),"{FFFF00}[INFO] {009D4F}Caminhoneiro %s estб sobrecarregado, pare-o e multe-o", DName);
Police_SendMessage(DS);
GameTextForPlayer(playerid,"Voce foi pego pela balanca, os policiais foram orientados a multa-lo.", 3000, 5);
SetPlayerWantedLevel(playerid, 1);
SetTimerEx("DLiberar", 1000*10, false, "i", playerid);
} else {
SendClientMessage(playerid, -1, "{FFFF00}[INFO] {009D4F}Vocк nгo estб sobrecarregado, boa viagem.");
SetTimerEx("DLiberar", 1000*10, false, "i", playerid);
}
return true;
}
forward DLiberar(playerid);
public DLiberar(playerid)return DCheck[playerid] = false;