10.02.2017, 08:53
Uh, I want to make a storage system inside my druglab but my question is.. how do I get the information from the druglab that the player is in? This is my code
The coords will be right because, if we think logic, it will go through all the druglabs and put the coords there, and if the player is in range of one of them it will work, but how does the system know that the player is inside druglab 3 so it will return the stock of the druglab with id 3?
Didn't tested yet but probably in the code above it will return the information from all druglabs.
PHP код:
else if(!strcmp(params, "info"))
{
for(new i = 0; i < MAX_DLABS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 60.0, DrugLabs[i][ExitX], DrugLabs[i][ExitY], DrugLabs[i][ExitZ]))
{
format(string, sizeof(string), ""COL_ORANGE"DROGURI:\n__________\n", string);
format(string, sizeof(string), "%sHeroina: %d\n", string, DrugLabs[i][Heroina]);
format(string, sizeof(string), "%sHeroina: %d\n", string, DrugLabs[i][Heroina]);
}
}
}
Didn't tested yet but probably in the code above it will return the information from all druglabs.