05.05.2013, 20:04
(
Последний раз редактировалось Exco; 05.05.2013 в 20:07.
Причина: Espaзos
)
No OnGameModeInit
No OnPlayerKeyStateChange:
Код:
CreatePickup(MODELO,TIPO,X,Y,Z);
Код:
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; }