If he's close to a biz
#1

How can I make the /enter command see at which business he is? I never worked with arrays before so thank you if you could help
Код:
#include <a_samp>

public OnGameModeInit()
{
	print("Business include by Sellize loaded");
	return 1;
}

public OnGameModeExit()
{
    print("Business include by Sellize unloaded");
	return 1;
}

forward CreateBusiness(type, Float:x, Float:y, Float:z, entrancefee);

public CreateBusiness(type, Float:x, Float:y, Float:z, entrancefee)
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        //
        return 1;
    }
    return 0;
}
Reply
#2

You may have something like this in your script:
PHP код:
#define MAX_BIZ 201 
Then, under your /enter cmd, you need to run a loop to see if the player is near one of them.
PHP код:
    for(new i=1i<MAX_BIZi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[i][bX], BizInfo[i][bY], BizInfo[i][bZ])) //or whatever your biz enum is
        
{
                 
//code
        
}
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)