Can't connect modes
#1

Hi all. I need some help to connect 2 tutorials in one system.

I took house system (https://sampforum.blast.hk/showthread.php?tid=179206) and made business based on this system.
Next i took earn system (public Payouttimer) from this tutorial (https://sampforum.blast.hk/showthread.php?tid=149416) but i have some issue.
I add line (SetPVarInt(playerid, "Businessearnings" , GetPVarInt(playerid, "Businessearnings") + BusinessInfo[buss][BusEarn]) in my command buy and sell business
Now i have add payout earn to saved business in
Код:
	if(strlen(dini_Get("Business.ini", Filename)))
	{
    	format(BusInfo[ID][BusOwner], 24, "%s", dini_Get("Business.ini", Filename));
    	BusInfo[ID][Owned] = 1;
        BusInfo[ID][Icon] = SetPlayerMapIconEx(Pickupx, Pickupy, Pickupz, 36, 1);
 	}
After this I add lines to get the playerid and pass it Payouttimer
Код:
        for(new i = 0; i <= MAX_PLAYERS; i++)
			{
    			if(IsPlayerConnected(i))
    				{
      					new playername2[MAX_PLAYER_NAME];
      					GetPlayerName(i, playername2, sizeof(playername2));
      					if(strcmp(playername2, BusInfo[ID][BusOwner], true, strlen(BusInfo[ID][BusOwner])) == 0)
 							{
        						return i;
      						}
                    }
			}
		SetPVarInt(BusInfo[ID][BusOwner], "Businessearnings" , GetPVarInt(BusInfo[ID][BusOwner], "Businessearnings") + BusInfo[ID][BusEarn]);
but this is no work. Can anyone help me how to get the playerid and pass it to Payouttimer to make it work.
Thanks.
Sorry for my bad english.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)