26.10.2012, 09:17
I've got this code:
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?
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;
}
How can I fix that?