[Pedido] Equipar apertando "F".
#4

No OnGameModeInit
Код:
	CreatePickup(MODELO,TIPO,X,Y,Z);
No OnPlayerKeyStateChange:
Код:
	if(newkeys & 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
	{
                if (PlayerToPoint(1, playerid,X,Y,Z))//COLOCA O LUGAR DA PICKUP
		{
			GivePlayerWeapon(playerid, 24, 100);
 			GivePlayerWeapon(playerid, 30, 200);
			
		}
	}
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
	{
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	tempposx = (oldposx -x);
	tempposy = (oldposy -y);
	tempposz = (oldposz -z);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
	return 1;
	}
	}
	return 0;
}
Reply


Messages In This Thread
Equipar apertando "F". - by ghbraz - 05.05.2013, 19:09
Re: [PEDIDO de TUTORIAL] Equipar apertando "F". - by xRaZeR - 05.05.2013, 19:12
Re: [PEDIDO de TUTORIAL] Equipar apertando "F". - by ghbraz - 05.05.2013, 19:52
Re: [PEDIDO de TUTORIAL] Equipar apertando "F". - by Exco - 05.05.2013, 20:04
Re: [PEDIDO de TUTORIAL] Equipar apertando "F". - by FixSkuL - 05.05.2013, 20:05
Re: [PEDIDO de TUTORIAL] Equipar apertando "F". - by ghbraz - 05.05.2013, 20:28
Re: [PEDIDO de TUTORIAL] Equipar apertando "F". - by ghbraz - 05.05.2013, 20:42

Forum Jump:


Users browsing this thread: 1 Guest(s)