Enterance
#1

Hello.. I want to create an enterance to my bussiness, but script does not working.. What i'm doing wrong?

pawn Код:
CMD:enter(playerid, params[])
{
if (PlayerToPoint(1.0, playerid,dini_Float(String, "EnterX"),dini_Float(String, "EnterY"),dini_Float(String, "EnterZ")))
{
SendClientMessage(playerid,COLOR_GREY,"works");
SetPlayerPos(playerid,dini_Float(String, "EnterX"),dini_Float(String, "EnterY"),dini_Float(String, "EnterZ")+1);
}

return 1;
}
Reply
#2

pawn Код:
CMD:enter(playerid, params[])
{
    if (PlayerToPoint(1.0, playerid,dini_Float(String, "EnterX"),dini_Float(String, "EnterY"),dini_Float(String, "EnterZ")))
    {
        SendClientMessage(playerid,COLOR_GREY,"works");
        SetPlayerPos(playerid,dini_Float(String, "EnterX"),dini_Float(String, "EnterY"),dini_Float(String, "EnterZ")+1);
    }

    return 1;
}
And you need to define PlayerToPoint, etc.
Reply
#3

I found one mistake too, but still not working

pawn Код:
CMD:enter(playerid, params[])
{
    if (PlayerToPoint(1.0, playerid,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")))
    {
        SendClientMessage(playerid,COLOR_GREY,"works");
        SetPlayerPos(playerid,dini_Float(String, "EnterX"),dini_Float(String, "EnterY"),dini_Float(String, "EnterZ")+1);
    }

    return 1;
}

I think i should do something with:

pawn Код:
for(new i=0; i<MAX_BUSS; i++)
    {
Reply
#4

Could someone help?

This is my house loading script

pawn Код:
stock LoadBusinesses()
{
    new count = 0;
    for(new i=0; i<MAX_BUSS; i++)
    {
        format(String,sizeof(String),"Business/%i.ini",i);
       
       
        if(dini_Exists(String))
        {
            BusinessInfo[i][PU] = CreateDynamicPickup(1272, 1, dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ"),-1, -1, -1,50.0);
            if(!strcmp(GetBusOwner(i), NO_OWNER, CASE_SENSETIVE))
            {
                format(Label, sizeof(Label), "Business Name: %s\nOwner: No Owner\nCost: $%i\nPayout: $%i",dini_Get(String, "Name"),dini_Int(String, "Cost"),dini_Int(String, "Payout"));
                BusinessInfo[i][bLabel] = Create3DTextLabel(Label,White,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")+1,100.0,0,1);
            }
            if(strcmp(GetBusOwner(i), NO_OWNER, CASE_SENSETIVE))
            {
                format(Label, sizeof(Label), "Business Name: %s\nOwner: %s\nCost: $%i\nPayout: $%i",dini_Get(String, "Name"), dini_Get(String, "Owner"),dini_Int(String, "Cost"),dini_Int(String, "Payout"));
                BusinessInfo[i][bLabel] = Create3DTextLabel(Label,White,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")+1,100.0,0,1);
            }
            count++;
        }
    }
    return printf("Total Businesses Loaded: %i",count);
}
Reply
#5

Try this:
Код:
CMD:enter(playerid, params[])
{
	for(new i=0; i<MAX_BUSS; i++)
	{
		format(String,sizeof(String),"Business/%i.ini",i);
        
		if(dini_Exists(String))
		{
			if (PlayerToPoint(1.0, playerid,dini_Float(String, "BusX"),dini_Float(String, "BusY"),dini_Float(String, "BusZ")))
			{
				SendClientMessage(playerid,COLOR_GREY,"works");
				SetPlayerPos(playerid,dini_Float(String, "EnterX"),dini_Float(String, "EnterY"),dini_Float(String, "EnterZ")+1);
			}
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)