Tag mismatch on rob system
#1

hey im trying to write a rob system into a script. I have applied a 10 sec timer and apllied animation, im stuck at trying to grab the business bank and take 75% give that to player and remove from biz bank. below should be everything to try and help me im getting error 017: tag mismatch and cant figure out what i have wrong.
pawn Код:
new in_biz[MAX_PLAYERS];

forward RobStore(playerid);

enum bInfo{

    bID,
    bOwner,
    bOwnerName[256],
    bPrice,
    Float:bSpawnX,
    Float:bSpawnY,
    Float:bSpawnZ,
    Float:bInteriorX,
    Float:bInteriorY,
    Float:bInteriorZ,
    bInterior,
    Text3D: bPickup,
    bOpen,
    bType,
    Float:bVX,
    Float:bVY,
    Float:bVZ,
    Float:bVR,
    bBank,
    bFuelPrice,
    bName[256],
    bBillTime,
    bEntranceFee,
    bLevel,
    bStream[256]

}

new BizInfo[MAX_BIZES][bInfo];


public RobStore(playerid)
{
    SetTimerEx("Rob",10000,false,"i",playerid);
    ApplyAnimation(playerid,"PED","gang_gunstand",4.0,0,1,1,0,10000,1);
    new biz = in_biz[playerid];
    new loot =(BizInfo[biz][bBank] * 0.75);  //THIS LINE IS GETTING THE TAG MISMATCH ERROR
    GivePlayerMoney(playerid, loot);
    BizInfo[biz][bBank] -= loot;
    return 1;
}

COMMAND:rob(playerid, params[])
{
    if(GetPlayerWeapon(playerid) > 22)
    {
        if(IsInStore(playerid))
        {
            RobStore(playerid);
            SendClientMessage(playerid,COLOR_RED,"You have started robbing this store.");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You are not in a store.");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You do not have a weapon.");
        return 1;
    }
}
thanks in advance for any help
Reply
#2

pawn Код:
new Float:loot = BizInfo[biz][bBank] * 0.75;
Reply
#3

thanks man simple simple simple, alwasy the shit i over look

actually do i have to change
pawn Код:
BizInfo[biz][bBank] -= loot
to
pawn Код:
BizInfo[biz][bBank] -= float:loot
Reply
#4

the command wasnt working correctly my
pawn Код:
new biz = in_biz[playerid];
    new loot =(BizInfo[biz][bBank] * 0.75);  //THIS LINE IS GETTING THE TAG MISMATCH ERROR
    GivePlayerMoney(playerid, loot);
    BizInfo[biz][bBank] -= loot;
was actually pullign from players bank and giving it to business so it to pull from biz bank now its not giving it to player and i get a server:command unknown ingame even though animation is done the clientmessage is not sent this is now hwo it stands
pawn Код:
COMMAND:rob(playerid, bizid, params[])
{
    if(GetPlayerWeapon(playerid) > 22)
    {
        if(IsInStore(playerid))
        {
            RobStore(playerid, bizid);
            SendClientMessage(playerid,COLOR_RED,"You have started robbing this store.");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You are not in a store.");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You do not have a weapon.");
        return 1;
    }
}

public RobStore(playerid,bizid)
{
    SetTimerEx("Rob",10000,false,"i",playerid);
    ApplyAnimation(playerid,"PED","gang_gunstand",4.0,0,1,1,0,10000,1);
    new biz = bizid;
    new Float:loot = BizInfo[biz][bBank] * 0.75;
    BizInfo[biz][bBank] -= Float:loot;
    GivePlayerMoney(playerid, float:loot);
    return 1;
}
compiles fine, but doesnt function correctly, is there abetterway of doing this?? that i dont know ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)