#include <a_samp> forward PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz); public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/AGENCIA", true) == 0) { if(PlayerToPoint(1.0,playerid,-3099.9595,1004.4452,19.5471)) { SetPlayerInterior(playerid,3); SetPlayerPos(playerid,378.2073,173.4705,1008.3828); } return 1; } if(strcmp(cmdtext, "/AGENCIA", true) == 0) { if(PlayerToPoint(1.0,playerid,-3099.9595,1004.4452,19.5471)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1462.4030,-1011.6450,26.8437); } return 1; } return 0; } public PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz) { if(IsPlayerConnected(playerid)) { new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -xx); tempposy = (oldposy -yy); tempposz = (oldposz -zz); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } return 0; }
if((newkeys == KEY_HORN))// troca o KEY_HORN pelo numero ou nome da tecla F
{
OnPlayerCommandText(playerid,"/portao"); //sу trocar o /portao pelo seu comando de entrar e sair
}
Originally Posted by Chivits
Eh bem facil ... sу que eu nao sei o numero da tecla F .. isso vc vai ter que procurar ... vou copiar um exemplo do meu gm pra ti.
pawn Код:
|
public OnPlayerKeysStateChange(playerid,newkeys,oldkeys)
{
if((newkeys & KEY_SECONDARY_ATTACK))
{
OnPlayerCommandText(playerid,"/portao"); //sу trocar o /portao pelo seu comando de entrar e sair
}
}
public OnPlayerKeysStateChange(playerid,newkeys,oldkeys)
{
if((newkeys & KEY_SECONDARY_ATTACK))
{
OnPlayerCommandText(playerid,"/entrar"); //sу trocar o /portao pelo seu comando de entrar e sair
}
}