14.07.2012, 14:59
Can Somebody tell me whats wrong in this CMD ??
When im out of Trucker veh it says your net in vehicle when i hop in trucker veh
its unknown command :/
Here is my trucker veh:
and:
When im out of Trucker veh it says your net in vehicle when i hop in trucker veh
its unknown command :/
pawn Code:
CMD:loadpackages(playerid, params[])
{
new string[128], packages;
// L1: 0 | L2: 100 | L3: 300 | L4: 700 | L5: 1200
if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 100) packages = 5;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 300) packages = 10;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 700) packages = 15;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 1200) packages = 20;
else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] >= 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_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))) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Trucker vehicle.");
if(!IsPlayerInRangeOfPoint(playerid, 5, 844.6911,-598.9043,18.4219)) 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;
}
pawn Code:
JobInfo[JOB_TRUCKER][jCars][0] = CreateVehicle(414,789.8238,-608.8157,16.1695,1.6426,0,1,1200); // T1
pawn Code:
stock IsTruckerVehicle(vehicleid)
{
for(new i=0; i<10; i++)
{
if(vehicleid == JobInfo[JOB_TRUCKER][jCars][i]) return 1;
}
return 0;
}