05.03.2019, 19:50
Tente assim:
#include <a_samp>
#define MAX_ENTRADAS 2
enum iF{
iNome[100],
Float:eX,
Float:eY,
Float:eZ,
FloatX,
FloatY,
FloatZ,
Interior
}
new EntradaInfo[MAX_ENTRADAS][iF] = {
{"Delegacia", 1555.1055, -1675.6426, 16.1953, 246.7995,65.9249,1003.6406, 6},
{"Delegacia Dillimore", 627.9832,-571.7913,17.4442, 246.7995,65.9249,1003.6406, 6}
};
public OnGameModeInit()
{
new StringS[300];
for(new inf = 0; inf< MAX_ENTRADAS; inf++)
{
format(StringS, sizeof StringS, "{FFFFFF}[{6495ED}%s{FFFFFF}]\nAperte 'F' para entrar", EntradaInfo[inf][iNome]);
Create3DTextLabel(StringS, -1, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ], 15.0, 0, 0);
CreatePickup(1239, 1, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ],-1);
CreatePickup(1239, 1, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ],-1);
format(StringS, sizeof StringS, "{FFFFFF}[{6495ED}%s{FFFFFF}]\nAperte 'F' para saida", EntradaInfo[inf][iNome]);
Create3DTextLabel(StringS, -1, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ], 15.0, 0, 0);
}
return true;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
for(new inf = 0; inf< MAX_ENTRADAS; inf++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ]))
return SetPlayerPos(playerid, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ]), SetPlayerInterior(playerid, EntradaInfo[inf][Interior]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ]))
return SetPlayerPos(playerid, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ]), SetPlayerInterior(playerid, EntradaInfo[inf][Interior]);
}
}
return true;
}
#include <a_samp>
#define MAX_ENTRADAS 2
enum iF{
iNome[100],
Float:eX,
Float:eY,
Float:eZ,
FloatX,
FloatY,
FloatZ,
Interior
}
new EntradaInfo[MAX_ENTRADAS][iF] = {
{"Delegacia", 1555.1055, -1675.6426, 16.1953, 246.7995,65.9249,1003.6406, 6},
{"Delegacia Dillimore", 627.9832,-571.7913,17.4442, 246.7995,65.9249,1003.6406, 6}
};
public OnGameModeInit()
{
new StringS[300];
for(new inf = 0; inf< MAX_ENTRADAS; inf++)
{
format(StringS, sizeof StringS, "{FFFFFF}[{6495ED}%s{FFFFFF}]\nAperte 'F' para entrar", EntradaInfo[inf][iNome]);
Create3DTextLabel(StringS, -1, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ], 15.0, 0, 0);
CreatePickup(1239, 1, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ],-1);
CreatePickup(1239, 1, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ],-1);
format(StringS, sizeof StringS, "{FFFFFF}[{6495ED}%s{FFFFFF}]\nAperte 'F' para saida", EntradaInfo[inf][iNome]);
Create3DTextLabel(StringS, -1, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ], 15.0, 0, 0);
}
return true;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
for(new inf = 0; inf< MAX_ENTRADAS; inf++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ]))
return SetPlayerPos(playerid, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ]), SetPlayerInterior(playerid, EntradaInfo[inf][Interior]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, EntradaInfo[inf][sX],EntradaInfo[inf][sY],EntradaInfo[inf][sZ]))
return SetPlayerPos(playerid, EntradaInfo[inf][eX],EntradaInfo[inf][eY],EntradaInfo[inf][eZ]), SetPlayerInterior(playerid, EntradaInfo[inf][Interior]);
}
}
return true;
}