if(carros estiverem em tal coordenada){
Veнculo(s) nгo spawna(m)
}
else {
Veнculo spawna
}
public OnVehicleSpawn(vehicleid)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(vehicleid,X,Y,Z);
if((X < 2464.032) && (X > -326.9805) && (Y < -829.1292) && (Y > -1051.009))
{
SendClientMessageToAll(0x00FF00FF, "Veiculo dentro GZ destruido");
DestroyVehicle(vehicleid);
}
else
{
SendClientMessageToAll( 0x00FF00FF, "Veiculo fora da GZ");
}
return 1;
}
AddPlayerClass(226,1033.3651,-1463.2262,13.5738,90.0886,0,0,0,0,0,0); // Esquerda abaixo
AddPlayerClass(226,978.2904,-1430.8750,13.5469,91.8802,0,0,0,0,0,0); // Direita acima
if (strcmp(cmd, "/respawncarros", true) == 0) {
if (IsPlayerConnected(playerid)) {
if (PlayerInfo[playerid][pAdmin] < 3) {
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!");
return true;
}
GetPlayerName(playerid, playername, sizeof(playername));
if (admtrampando[playerid] == 1 && admhide[playerid] == 1) {
format(string, sizeof(string), "[Atenзгo] Todos os carros foram para seus locais de inicio. By: ADM_OCULTO ");
} else {
format(string, sizeof(string), "[Atenзгo] Todos os veнculos foram para seus locais de inicio. By: %s.", playername);
}
SendClientMessageToAll(COLOR_LIGHTRED, string);
new bool: unwanted[CAR_AMOUNT];
for (new player = 0; player < MAX_PLAYERS; player++) {
if (IsPlayerConnected(player) && IsPlayerInAnyVehicle(player)) {
unwanted[GetPlayerVehicleID(player)] = true;
}
}
for (new car = 1; car <= CAR_AMOUNT; car++) {
if (unwanted[car] == false) {
SetVehicleToRespawn(car);
}
}
}
return 0;
}
if (strcmp(cmd, "/respawncarros", true) == 0) {
if (IsPlayerConnected(playerid)) {
if (PlayerInfo[playerid][pAdmin] < 3) {
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!");
return true;
}
GetPlayerName(playerid, playername, sizeof(playername));
if (admtrampando[playerid] == 1 && admhide[playerid] == 1) {
format(string, sizeof(string), "[Atenзгo] Todos os carros foram para seus locais de inicio. By: ADM_OCULTO ");
} else {
format(string, sizeof(string), "[Atenзгo] Todos os veнculos foram para seus locais de inicio. By: %s.", playername);
}
SendClientMessageToAll(COLOR_LIGHTRED, string);
new bool: unwanted[CAR_AMOUNT];
for (new player = 0; player < MAX_PLAYERS; player++) {
if (IsPlayerConnected(player) && IsPlayerInAnyVehicle(player)) {
unwanted[GetPlayerVehicleID(player)] = true;
}
}
for (new car = 1; car <= CAR_AMOUNT; car++)
{
if (unwanted[car] == false)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(car, X, Y, Z);
if((X < 2464.032) && (X > -326.9805) && (Y < -829.1292) && (Y > -1051.009))
{
}
else
{
SetVehicleToRespawn(car);
}
}
}
}
return 0;
}
//if((X < POS_X_MAX) && (X > POS_X_MIN) && (Y < POS_Y_MAX) && (Y > POS_Y_MIN))
GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy) |
if (strcmp(cmd, "/respawncarros", true) == 0) {
if (IsPlayerConnected(playerid)) {
if (PlayerInfo[playerid][pAdmin] < 3) {
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando!");
return true;
}
GetPlayerName(playerid, playername, sizeof(playername));
if (admtrampando[playerid] == 1 && admhide[playerid] == 1) {
format(string, sizeof(string), "[Atenзгo] Todos os carros foram para seus locais de inicio. By: Mr_Capitao.");
} else {
format(string, sizeof(string), "[Atenзгo] Todos os veнculos foram para seus locais de inicio. By: %s.", playername);
}
SendClientMessageToAll(COLOR_LIGHTRED, string);
new bool: unwanted[CAR_AMOUNT];
for (new player = 0; player < MAX_PLAYERS; player++) {
if (IsPlayerConnected(player) && IsPlayerInAnyVehicle(player)) {
unwanted[GetPlayerVehicleID(player)] = true;
}
}
for (new car = 1; car <= CAR_AMOUNT; car++)
{
if (unwanted[car] == false)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(car, X, Y, Z);
if((X < 942.2568) && (X > -1500.266) && (Y < 1086.765) && (Y > -1401.572))
{
//
}
else
{
SetVehicleToRespawn(car);
}
}
}
}
return 0;
}
if (strcmp(cmd, "/testecord", true) == 0)
{
new sennior;
sennior = GangZoneCreate(942.2568, -1500.266, 1086.765, -1401.572);
GangZoneShowForPlayer(playerid, sennior, 0x00FFFF5C);
return 1;
}
if((X < 1086.765) && (X > 942.2568) && (Y < -1401.572) && (Y > -1500.266))
(Float:minx, Float:miny, Float:maxx, Float:maxy) (942.2568, -1500.266, 1086.765, -1401.572); |
((X < POS_X_MAX) && (X > POS_X_MIN) && (Y < POS_Y_MAX) && (Y > POS_Y_MIN)) |
942.2568, -1500.266, 1086.765, -1401.572
Funcionou, obrigado, poderia me explicar a ordem de pegar as coordenadas aqui?
PHP код:
Por exemplo, vocк colocou o 1086.765 primeiro, depois o 942.2568 ... |
if((X > 942.2568) && (Y > -1500.266) && (X < 1086.765) && (Y < -1401.572))