Something wrong...
#1

Код:
	if(newstate == PLAYER_STATE_DRIVER)
	{
	new vehicleid = GetPlayerVehicleID(playerid);
	new vehiclemodel = GetVehicleModel(vehicleid);
	new suvip[50];
	new bevipo[50];
	new msg[150];
	if( vehiclemodel == 596 || vehiclemodel == 597 || vehiclemodel == 599 || vehiclemodel == 497 || vehiclemodel == 523 )
	{
	if(PlayerData[playerid][Darbas] !=1 ) return RemovePlayerFromVehicle(playerid), ShowPlayerDialog(playerid,544,DIALOG_STYLE_MSGBOX,"Policijos Departamentas","{BD11F7}Norint vairuoti љią transporto priemonę, jums reikia {FA6C0E}priklausyti{BD11F7}/{33F810}dirbti {FA6C0E}mafijai{BD11F7}/{33F810}љiame darbe","Supratau","");
	if(PlayerData[playerid][Vip] == 0)
	{
	if(PlayerData[playerid][Lygis] == 0) bevipo = "25";
	else if(PlayerData[playerid][Lygis] == 1) bevipo = "50";
	else if(PlayerData[playerid][Lygis] == 2) bevipo = "100";
	else if(PlayerData[playerid][Lygis] == 3) bevipo = "125";
	else if(PlayerData[playerid][Lygis] == 4) bevipo = "150";
	else if(PlayerData[playerid][Lygis] == 5) bevipo = "200";
	else if(PlayerData[playerid][Lygis] == 6) bevipo = "225";
	else if(PlayerData[playerid][Lygis] == 7) bevipo = "250";
	else if(PlayerData[playerid][Lygis] == 8) bevipo = "300";
	else if(PlayerData[playerid][Lygis] == 9) bevipo = "325";
	else if(PlayerData[playerid][Lygis] == 10) bevipo = "350";
	else if(PlayerData[playerid][Lygis] == 11) bevipo = "400";
	else if(PlayerData[playerid][Lygis] == 12) bevipo = "425";
	else if(PlayerData[playerid][Lygis] == 13) bevipo = "450";
	else if(PlayerData[playerid][Lygis] == 14) bevipo = "500";
	else if(PlayerData[playerid][Lygis] == 15) bevipo = "525";
	else if(PlayerData[playerid][Lygis] == 16) bevipo = "550";
	else if(PlayerData[playerid][Lygis] == 17) bevipo = "600";
	else if(PlayerData[playerid][Lygis] == 18) bevipo = "625";
	else if(PlayerData[playerid][Lygis] == 19) bevipo = "650";
	else if(PlayerData[playerid][Lygis] == 20) bevipo = "700";
	else if(PlayerData[playerid][Lygis] == 21) bevipo = "725";
	else if(PlayerData[playerid][Lygis] == 22) bevipo = "750";
	else if(PlayerData[playerid][Lygis] == 23) bevipo = "800";
	else if(PlayerData[playerid][Lygis] == 24) bevipo = "825";
	else if(PlayerData[playerid][Lygis] == 25) bevipo = "850";
	////////////KITA DIELA//////////
	if(PlayerData[playerid][Lygis] == 0) suvip = "50";
	else if(PlayerData[playerid][Lygis] == 1) suvip = "100";
	else if(PlayerData[playerid][Lygis] == 2) suvip = "150";
	else if(PlayerData[playerid][Lygis] == 3) suvip = "200";
	else if(PlayerData[playerid][Lygis] == 4) suvip = "250";
	else if(PlayerData[playerid][Lygis] == 5) suvip = "300";
	else if(PlayerData[playerid][Lygis] == 6) suvip = "350";
	else if(PlayerData[playerid][Lygis] == 7) suvip = "400";
	else if(PlayerData[playerid][Lygis] == 8) suvip = "450";
	else if(PlayerData[playerid][Lygis] == 9) suvip = "500";
	else if(PlayerData[playerid][Lygis] == 10) suvip = "550";
	else if(PlayerData[playerid][Lygis] == 11) suvip = "600";
	else if(PlayerData[playerid][Lygis] == 12) suvip = "650";
	else if(PlayerData[playerid][Lygis] == 13) suvip = "700";
	else if(PlayerData[playerid][Lygis] == 14) suvip = "750";
	else if(PlayerData[playerid][Lygis] == 15) suvip = "800";
	else if(PlayerData[playerid][Lygis] == 16) suvip = "850";
	else if(PlayerData[playerid][Lygis] == 17) suvip = "900";
	else if(PlayerData[playerid][Lygis] == 18) suvip = "950";
	else if(PlayerData[playerid][Lygis] == 19) suvip = "1000";
	else if(PlayerData[playerid][Lygis] == 20) suvip = "1050";
	else if(PlayerData[playerid][Lygis] == 21) suvip = "1100";
	else if(PlayerData[playerid][Lygis] == 22) suvip = "1150";
	else if(PlayerData[playerid][Lygis] == 23) suvip = "1200";
	else if(PlayerData[playerid][Lygis] == 24) suvip = "1250";
	else if(PlayerData[playerid][Lygis] == 25) suvip = "1300";
	
	format(msg, sizeof(msg), "{23C8D6}Vaћinėdami su љia Tr.Priemone be {EA1A0F}'VIP'{23C8D6} gausite {1FE428}%d Lt/min{23C8D6} su {EA1A0F}'VIP' {1FE428} %d Lt/min",bevipo,suvip);
	SendClientMessage(playerid, -1,msg);
	if(PlayerData[playerid][Vip] == 1)
	{
	}
	if(PlayerData[playerid][Vip] == 0)
	{
    Uzdarbio[playerid] = SetTimerEx("Alga", 60000, true, "i", playerid);
		}
	}
}
}
Lygis == Level )
I geting bad numbers

Reply
#2

Well, you first declare bevipo and suvip as strings, and then try to format them as decimals:
Код:
new suvip[50];
new bevipo[50];
.
.
.
format(msg, sizeof(msg), "{23C8D6}Važinėdami su šia Tr.Priemone be {EA1A0F}'VIP'{23C8D6} gausite {1FE428}%d Lt/min{23C8D6} su {EA1A0F}'VIP' {1FE428} %d Lt/min",bevipo,suvip);
SendClientMessage(playerid, -1,msg);
Now if you want to output those only as decimals, declare them simply by
pawn Код:
new suvip, bevipo;
and remove the quotes from the assignment. Else, replace "%d" with "%s" and instead of making
Код:
if(PlayerData[playerid][Lygis] == 0) bevipo = "25";
else if(PlayerData[playerid][Lygis] == 1) bevipo = "50";
do it with format or with bevipo[0]='2', bevipo[1]='5' etc.

Although, i recommand you use the first method.
Reply
#3

When i delete, its says must be assigned to an array and i get like 26 errors
Reply
#4

pawn Код:
//
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        switch(GetVehicleModel(vehicleid))
        {
            case 497, 523, 596, 597, 599:
            {
                if(PlayerData[playerid][Darbas] != 1)
                {
                    RemovePlayerFromVehicle(playerid);
                    return ShowPlayerDialog(playerid, 544, DIALOG_STYLE_MSGBOX, "Policijos Departamentas", "{BD11F7}Norint vairuoti љia transporto priemone, jums reikia {FA6C0E}priklausyti{BD11F7}/{33F810}dirbti {FA6C0E}mafijai{BD11F7}/{33F810}љiame darbe", "Supratau", "");
                }
                if(!PlayerData[playerid][Vip])
                {
                    new var = PlayerData[playerid][Lygis], suvip, bevipo, fstr[140];
                    switch(var)
                    {
                        case 0, 1:      bevipo = 25 + (var * 25);
                        case 2 .. 4:    bevipo = 100 + ((var - 2) * 25);
                        case 5 .. 7:    bevipo = 200 + ((var - 5) * 25);
                        case 8 .. 10:   bevipo = 300 + ((var - 8) * 25);
                        case 11 .. 13:  bevipo = 400 + ((var - 11) * 25);
                        case 14 .. 16:  bevipo = 500 + ((var - 14) * 25);
                        case 17 .. 19:  bevipo = 600 + ((var - 17) * 25);
                        case 20 .. 22:  bevipo = 700 + ((var - 20) * 25);
                        case 23 .. 25:  bevipo = 800 + ((var - 23) * 25);
                    }
                    suvip = 50 + (var * 50);
                    format(fstr, sizeof(fstr), "{23C8D6}Vaћinedami su љia Tr.Priemone be {EA1A0F}'VIP'{23C8D6} gausite {1FE428}%d Lt/min{23C8D6} su {EA1A0F}'VIP' {1FE428} %d Lt/min", bevipo, suvip);
                    SendClientMessage(playerid, -1, fstr);
                    Uzdarbio[playerid] = SetTimerEx("Alga", 60000, true, "i", playerid);
                }
            }
        }
    }
:S
Reply


Forum Jump:


Users browsing this thread: