Help with counter
#1

Hello i have system that pays for driving but its works not like i set hare is my system :

1min counter on player connect :
Код:
Zaidimas[playerid] = SetTimerEx("zaidimas",60000,true,"d",playerid );
and hare is my function that call counter :
Код:
public zaidimas(playerid)
{
	/////////////////////////////////////Uzdarbis uz vazinejima ///////////////
	algacount[playerid] = floatround(GetPlayerScore( playerid )/500+10);
	if( GetPlayerState( playerid ) == PLAYER_STATE_PASSENGER || GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
		{/////////////POLICIJOS///////////////
		    if(PlayerInfo[playerid][JobID] == 1)
			{
				if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 497 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 596 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 599 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 523 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 427)
				{
				    if(PlayerInfo[playerid][Vip] == 1)
				    {
						PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
						if(PlayerInfo[playerid][JobLevel] == 2)
						{
						    PlayerInfo[playerid][Uzdirbau] +=5;
						}
						else if(PlayerInfo[playerid][JobLevel] == 3 || PlayerInfo[playerid][JobLevel] == 4)
						{
                            PlayerInfo[playerid][Uzdirbau] +=10;
						}
						else if(PlayerInfo[playerid][JobLevel] == 5)
						{
                            PlayerInfo[playerid][Uzdirbau] +=20;
						}
						else if(PlayerInfo[playerid][JobLevel] == 6)
						{
                            PlayerInfo[playerid][Uzdirbau] +=25;
						}
						else if(PlayerInfo[playerid][JobLevel] == 7)
						{
                            PlayerInfo[playerid][Uzdirbau] +=30;
						}
					}
					else
					{
                        PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
                        if(PlayerInfo[playerid][JobLevel] == 2)
						{
						    PlayerInfo[playerid][Uzdirbau] +=5;
						}
						else if(PlayerInfo[playerid][JobLevel] == 3 || PlayerInfo[playerid][JobLevel] == 4)
						{
                            PlayerInfo[playerid][Uzdirbau] +=10;
						}
						else if(PlayerInfo[playerid][JobLevel] == 5)
						{
                            PlayerInfo[playerid][Uzdirbau] +=20;
						}
						else if(PlayerInfo[playerid][JobLevel] == 6)
						{
                            PlayerInfo[playerid][Uzdirbau] +=25;
						}
						else if(PlayerInfo[playerid][JobLevel] == 7)
						{
                            PlayerInfo[playerid][Uzdirbau] +=30;
						}
					}
				}
			}
		}

	return 1;
}
yes this function works , problem is with money i get in minute , so i have vip and get score/500+20 per min and i have my job level 2 so i get extra 5 per min so in total i get 25$ per min , but the thing is in 1.45min i get 125$ , not sure ware is problem please help my ( i have noticed that sometimes i get like 25 and after few seconds again 25 then pass about 30-40 sec and again ) please help
Reply
#2

solve by doing this , still tnx

Код:
/////////////////////////////////////Uzdarbis uz vazinejima ///////////////
	algacount[playerid] = floatround(GetPlayerScore( playerid )/500+10);
	if( GetPlayerState( playerid ) == PLAYER_STATE_PASSENGER || GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
		{/////////////POLICIJOS///////////////
		    if(PlayerInfo[playerid][JobID] == 1)
			{
				if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 497 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 596 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 599 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 523 || GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 427)
				{
				    if(PlayerInfo[playerid][Vip] == 1)
				    {
						if(PlayerInfo[playerid][JobLevel] <2)
						{
                            PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
						}
						else if(PlayerInfo[playerid][JobLevel] == 2)
						{
							PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
						    PlayerInfo[playerid][Uzdirbau] +=5;
						}
						else if(PlayerInfo[playerid][JobLevel] == 3 || PlayerInfo[playerid][JobLevel] == 4)
						{
							PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
                            PlayerInfo[playerid][Uzdirbau] +=10;
						}
						else if(PlayerInfo[playerid][JobLevel] == 5)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
                            PlayerInfo[playerid][Uzdirbau] +=20;
						}
						else if(PlayerInfo[playerid][JobLevel] == 6)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
                            PlayerInfo[playerid][Uzdirbau] +=25;
						}
						else if(PlayerInfo[playerid][JobLevel] == 7)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid]*2;
                            PlayerInfo[playerid][Uzdirbau] +=30;
						}
					}
					else
					{
                        if(PlayerInfo[playerid][JobLevel] <2)
						{
                            PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
						}
                        else if(PlayerInfo[playerid][JobLevel] == 2)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
						    PlayerInfo[playerid][Uzdirbau] +=5;
						}
						else if(PlayerInfo[playerid][JobLevel] == 3 || PlayerInfo[playerid][JobLevel] == 4)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
                            PlayerInfo[playerid][Uzdirbau] +=10;
						}
						else if(PlayerInfo[playerid][JobLevel] == 5)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
                            PlayerInfo[playerid][Uzdirbau] +=20;
						}
						else if(PlayerInfo[playerid][JobLevel] == 6)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
                            PlayerInfo[playerid][Uzdirbau] +=25;
						}
						else if(PlayerInfo[playerid][JobLevel] == 7)
						{
						    PlayerInfo[playerid][Uzdirbau] +=algacount[playerid];
                            PlayerInfo[playerid][Uzdirbau] +=30;
						}
					}
				}
			}
			//else
		}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)