31.05.2013, 17:42
As i know the function
You get his vehicle id,and it can't be changed to a car id. so i beleive it's like
pawn Код:
GetPlayerVehicleID(playerid);
pawn Код:
if (strcmp("/unloadlogs", cmdtext, true, 10) == 0)
{
if(GetPlayerScore(playerid) >= -500)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2334.8611, -2081.3384, 13.5469))
{
new Vehid = GetPlayerVehicleID(playerid);
if(Vehdid == 422)
{
if(CarInfo[Vehid] [logs] == 1)
{
CarInfo[Vehid][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!");
}
}

