Mechanic /applyjob problem.
#1

I've got this code:
pawn Код:
CMD:applymod(playerid, params[])
{
    if(PlayerInfo[playerid][pJob] !=7)
        return 1;
    new
        id,
        mod[128],
        modid,
        hascomp
    ;
    if(sscanf(params,"is[128]i",id,mod,modid))
        return SendClientMessage(playerid,C_NICE,"[Usage] {FFFFFF}/applymod [playerid/PON] [rims/hydraulics/radio/nos/addons] [modid]");
    if(equal(mod,"rims",true))
    {
        ForLoop(i,12)
        {
            if(PlayerInfo[playerid][pRSet][i] !=modid || PlayerInfo[playerid][pRSetA][i] < 1)
            {
                hascomp = 0;
                break;
            }
            else
            {
                PlayerInfo[playerid][pRSetA][i]--;
                AddVehicleComponent(GetPlayerVehicleID(id),modid);
                SendClientMessage(id,C_NICE,"[Mechanic] {FFFFFF}New wheels were installed for your vehicle.");
                break;
            }
        }
    }
    if(!hascomp)
        return SendClientMessage(playerid,C_RED,"You do not have these components.");
    return 1;
}
You get 3 sets of virtual wheels once you take the job, but the thing is, it works, but it executed "New will has been installed" and then "You do not have these components".

How can I fix that?
Reply


Messages In This Thread
Mechanic /applyjob problem. - by printer - 26.10.2012, 09:17
Re: Mechanic /applyjob problem. - by Finn - 26.10.2012, 10:42
Re: Mechanic /applyjob problem. - by printer - 26.10.2012, 10:59

Forum Jump:


Users browsing this thread: 1 Guest(s)