30.08.2015, 02:08
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys)
{
if(newkeys == KEY_CROUCH)
{
if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) return true;
for(new i = 0; i < MAX_SERVER_ITENS; i++) {
if(mundoItens[i][mItem_ativo] == false) continue;
if(!IsPlayerInRangeOfPoint(playerid, 1.0, mundoItens[i][mItem_x], mundoItens[i][mItem_y], mundoItens[i][mItem_z])) continue;
for(new b = 0; b < 21; b++)
{
if(pInventario[playerid][b][inv_item_index] == 0)
{
pInventario[playerid][b][inv_item_index] = serverItens[mundoItens[b][mItem_index]][sItem_modelo];
PlayerTextDrawSetPreviewModel(playerid, ITENS_INV[b][playerid], serverItens[mundoItens[i][mItem_index]][sItem_modelo]);
break;
}
}
}
return 1;
}