25.03.2017, 14:52
I have done it different without pickups, but using objects.
But now i need to know how i define an item name for an modelid.
And then i need to know how i display it in a string.
How can i do this? does anyone have an example for me?
But now i need to know how i define an item name for an modelid.
And then i need to know how i display it in a string.
How can i do this? does anyone have an example for me?
PHP код:
if(newkeys==KEY_CROUCH)
{
for(new i = 0; i < sizeof(ItemInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0,ItemInfo[i][ItemPosX],ItemInfo[i][ItemPosY],ItemInfo[i][ItemPosZ]))
{
if(GetPlayerVirtualWorld(playerid) == ItemInfo[i][ItemVWorld] && GetPlayerInterior(playerid) == ItemInfo[i][ItemInterior])
{
if(ItemInfo[i][Toggled] == 0)
{
new modelid = ItemInfo[i][ItemModelID];
new str[128];
format(str,sizeof(str),"%s(%i) has picked up a item from their surroundings.",PlayerName(playerid),playerid);
SendNearbyMessage(playerid,30.0,str,ORANGE);
AddItem(playerid,modelid);
ItemInfo[i][Toggled] = 1;
Delete3DTextLabel(Label2[i]);
DestroyDynamicObject(Item[i]);
NoCheat[playerid] = 1;
return 1;
}
}else return 0;
}
}
}