31.05.2013, 17:38
This is the code im using for command /unloadlogs, it's same for /loadlogs witch doesn't work either.
However, after testing the script for some time, I can't get it why spawning truckID 422, at the right location still gives me "You are not in a truck, that can deliver logs!"
Thanks for help in advance!
However, after testing the script for some time, I can't get it why spawning truckID 422, at the right location still gives me "You are not in a truck, that can deliver logs!"
pawn Код:
if (strcmp("/unloadlogs", cmdtext, true, 10) == 0)
{
if(GetPlayerScore(playerid) >= -500)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2334.8611, -2081.3384, 13.5469))
{
if(GetPlayerVehicleID(422))
{
if(CarInfo[GetPlayerVehicleID(422)] [logs] == 1)
{
CarInfo[GetPlayerVehicleID(422)][logs] = 0;
new cash = random(30000);
GivePlayerMoney(playerid, cash);
new string[128];
format(string,sizeof(string),"You earned %d$ from the delivery",cash);
SendClientMessage(playerid,COLOR_GREEN,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Your truck is empety!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in a truck, that can deliver logs!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You cannot unload your truck here!");
}
}