Tag mismatching?
#1

I am trying to script stuff for my server but I keep getting these random tag mismatch errors

pawn Код:
if(Octane[playerid] == 1) return GiveDodMoney(playerid, -(Refill[playerid]*4*2.10));
        if(Octane[playerid] == 2) return GiveDodMoney(playerid, -(Refill[playerid]*4*2.16));
        if(Octane[playerid] == 3) return GiveDodMoney(playerid, -(Refill[playerid]*4*2.32));
        if(Octane[playerid] == 4) return GiveDodMoney(playerid, -(Refill[playerid]*4*2.99));
Now, this gives me these errors

pawn Код:
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39088) : warning 213: tag mismatch
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39089) : warning 213: tag mismatch
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39090) : warning 213: tag mismatch
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39091) : warning 213: tag mismatch
But I used the exact same thing for my other ones, and they don't give me warnings.

Lines: 39099-39102

pawn Код:
if(Octane[playerid] == 1) { FamInfo[idx][fMoney] += Refill[playerid]*4/2.10; }
            else if(Octane[playerid] == 2) { FamInfo[idx][fMoney] += Refill[playerid]*4/2.16; }
            else if(Octane[playerid] == 3) { FamInfo[idx][fMoney] += Refill[playerid]*4/2.32; }
            else if(Octane[playerid] == 4) { FamInfo[idx][fMoney] += Refill[playerid]*4/2.99; }
Any idea what's up?
Reply
#2

-= with an equal symbol at the end of ' - ', not just -
Reply
#3

Nope, that is not correct because it gives me these errors now

pawn Код:
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39088) : error 022: must be lvalue (non-constant)
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39089) : error 022: must be lvalue (non-constant)
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39090) : error 022: must be lvalue (non-constant)
C:\Users\KiNG3\Desktop\Pengu1n\Gameservers\SA-MP\zGaming\gamemodes\URSP.pwn(39091) : error 022: must be lvalue (non-constant)
Reply
#4

pawn Код:
if(Octane[playerid] == 1) return GiveDodMoney(playerid, -floatround(Refill[playerid]*4*2.10, floatround_ceil));
if(Octane[playerid] == 2) return GiveDodMoney(playerid, -floatround(Refill[playerid]*4*2.16, floatround_ceil));
if(Octane[playerid] == 3) return GiveDodMoney(playerid, -floatround(Refill[playerid]*4*2.32, floatround_ceil));
if(Octane[playerid] == 4) return GiveDodMoney(playerid, -floatround(Refill[playerid]*4*2.99, floatround_ceil));
Also why not simplify that code?

pawn Код:
new
    Float:multiplier = 2.10;
switch(Octane[playerid]) {
    case 2: multiplier = 2.16;
    case 3: multiplier = 2.32;
    case 4: multiplier = 2.99;
    default: multiplier = 2.10;
}
return GiveDodMoney(playerid, -floatround(Refill[playerid] * 4 * multiplier, floatround_ceil));
Reply
#5

Well I just want to make my system, what I do is... I build what I want to build, then I go back and find a better more efficient way of creating it.
Reply
#6

There's nothing wrong with that, but when you'll have to go back in future to fix/add something, then eyes tend to bleed

This version isn't more efficient, but it won't cause any problems to add some new values in future using half the code from first version.
Reply
#7

Nah, your way wouldn't hurt at all.... I actually never thought of doing simple ways of *2/2.10 (etc). I will think of it next time though


Off-topic: 400th post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)