16.07.2010, 18:08
Okay so, I got this command:
And I got a problem with it.
The problem is.. when I type the cmd and I'm near a garbage truck or not, it gives me this message:
"You can only load trash into garbage trucks."
pawn Код:
if (strcmp(cmd, "/loadtrash", true) == 0)
{
if(PlayerInfo[playerid][pJob] == 1)
{
new vehicle = GetPlayerClosestVehicle(5.0, playerid);
if(vehicle)
{
if(IsGarbageTruck(vehicle))
{
Trash[vehicle] += gHasTrash[playerid];
format(string, sizeof(string), "You have loaded %d trash into the trashmaster, trashmaster trash: %d/20", gHasTrash[playerid], Trash[vehicle]);
SCM(playerid, 0x8CFFFFFF, string);
gHasTrash[playerid] = 0;
}
else if(!IsGarbageTruck(vehicle))
{
SCM(playerid, COLOR_GREY, "You can only load trash into garbage trucks.");
}
}
else
{
SCM(playerid, COLOR_GREY, "You are not near a garbage truck.");
}
}
else
{
SCM(playerid, COLOR_GREY, "* You are not a garbage collector.");
}
return 1;
}
The problem is.. when I type the cmd and I'm near a garbage truck or not, it gives me this message:
"You can only load trash into garbage trucks."