Problem with a job -
Oscii - 11.11.2012
pawn Код:
CMD:getmats(playerid, params[])
{
new string[128], packages;
if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 100) packages = 5;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 300) packages = 10;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 700) packages = 15;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 1200) packages = 20;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] >= 1200) packages = 25;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pJob] != JOB_WSMUGGLER && PlayerInfo[playerid][pVIPJob] != JOB_DSMUGGLER) return SendClientMessage(playerid, COLOR_GREY, "You are not a Weapons Smuggler.");
if(PlayerInfo[playerid][pMPackages]) return SendClientMessage(playerid, COLOR_GREY, "You already have packages.");
if(!IsPlayerInRangeOfPoint(playerid, 3, -172.3404,1022.7706,19.7422)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the Materials Pickup.");
if(PlayerInfo[playerid][pMoney] < packages*25) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
PlayerInfo[playerid][pMPackages] = 1;
GiveZaiatMoney(playerid, -(packages*25));
if(PointInfo[3][pOwner])
{
new idx = PointInfo[3][pOwner];
FamInfo[idx][fMoney] += packages*25;
PointInfo[3][pProfit] += packages*25;
}
format(string, sizeof(string), "* %s has loaded %d materials packages from the pickup.", RPN(playerid), packages);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
format(string, sizeof(string), "* You have loaded {FF6347}%d materials{33CCFF} packages for {FF6347}$%d{33CCFF}, deliver them to the Materials Dropoff. (Checkpoint)", packages, packages*25);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPlayerCheckpoint(playerid,-21.4871,1159.8158,19.3902,3);
AntiTPTimer[playerid] = SetTimerEx("AntiTPHacks", 30000, false, "d", playerid);
return 1;
}
Hello, every time i try to type /getmats at the position i've set, it just returns 'your not a drug's smuggler'
Anyone know a resolution?
Regards
Oscii
Re: Problem with a job -
XtremeR - 11.11.2012
pawn Код:
CMD:getmats(playerid, params[])
{
new string[128], packages;
if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 100) packages = 5;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 300) packages = 10;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 700) packages = 15;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 1200) packages = 20;
else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] >= 1200) packages = 25;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pMPackages]) return SendClientMessage(playerid, COLOR_GREY, "You already have packages.");
if(!IsPlayerInRangeOfPoint(playerid, 3, -172.3404,1022.7706,19.7422)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the Materials Pickup.");
if(PlayerInfo[playerid][pMoney] < packages*25) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
PlayerInfo[playerid][pMPackages] = 1;
GiveZaiatMoney(playerid, -(packages*25));
if(PointInfo[3][pOwner])
{
new idx = PointInfo[3][pOwner];
FamInfo[idx][fMoney] += packages*25;
PointInfo[3][pProfit] += packages*25;
}
format(string, sizeof(string), "* %s has loaded %d materials packages from the pickup.", RPN(playerid), packages);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
format(string, sizeof(string), "* You have loaded {FF6347}%d materials{33CCFF} packages for {FF6347}$%d{33CCFF}, deliver them to the Materials Dropoff. (Checkpoint)", packages, packages*25);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPlayerCheckpoint(playerid,-21.4871,1159.8158,19.3902,3);
AntiTPTimer[playerid] = SetTimerEx("AntiTPHacks", 30000, false, "d", playerid);
return 1;
}
will work perfectly fine!
Re: Problem with a job -
Oscii - 11.11.2012
Thank you very much, +1 rep'd.
I have one more problem, with a command.
it's /loadpackages <<--- trucker job
pawn Код:
CMD:loadpackages(playerid, params[])
{
new string[128], packages;
// L1: 0 | L2: 100 | L3: 300 | L4: 700 | L5: 1200
if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 250) packages = 5;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 500) packages = 10;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 800) packages = 15;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 1000) packages = 20;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] >= 1700) packages = 25;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pJob] != JOB_TRUCKER && PlayerInfo[playerid][pVIPJob] != JOB_TRUCKER) return SendClientMessage(playerid, COLOR_GREY, "You are not a Trucker.");
if(PlayerInfo[playerid][pTPackages] == 2) return SendClientMessage(playerid, COLOR_GREY, "You already have overloaded packages.");
if(!IsPlayerInAnyVehicle(playerid) || !IsTruckerVehicle(GetPlayerVehicleID(playerid)) || !IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Trucker vehicle or you have no trailer attached.");
if(!IsPlayerInRangeOfPoint(playerid, 5, 257.7331,1480.7288,10.5859)) return SendClientMessage(playerid, COLOR_GREY, "You are not near a packages pickup.");
if(PlayerInfo[playerid][pMoney] < packages*5) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
PlayerInfo[playerid][pTPackages] ++;
GiveZaiatMoney(playerid, -(packages*5));
PlayerInfo[playerid][pDeliverTruck] = GetPlayerVehicleID(playerid);
TruckPackages[GetPlayerVehicleID(playerid)] = playerid;
format(string, sizeof(string), "* %s has loaded %d products packages from the pickup.", RPN(playerid), packages);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
format(string, sizeof(string), "* You have loaded {FF6347}%d products{33CCFF} packages for {FF6347}$%d{33CCFF}, deliver them to the dropoff. (Checkpoint)", packages, packages*5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
if(PlayerInfo[playerid][pTPackages] != 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You can overload packages by typing /loadpackages again, cops will be notified though.");
}
SetPlayerCheckpoint(playerid, 2222.5107,-2682.7368,13.5409, 2);
if(PlayerInfo[playerid][pTPackages] == 2)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "* You have overloaded packages, the Police Department has been notified as a result.");
SendCopMessage(COLOR_BLUE, "Products Depot: A truck has overloaded packages and is on it way to the dropoff now.");
}
return 1;
}
Whenever I type it it gives me unknown command, but works when i'm away from it by returning 'your not near the pickup point'
Resolution?