[pomoc] /buyprods

Započeo dane_1, Oktobar 28, 2011, 18:40:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: LARP
Detaljan opis problema: Ovako..kad odem /buyprods u kamionu za prodse pise mi server unknown command..Kad izadem pise mi nisi u vozilu ,,Jel se kako moze sredit da bude normalno da u odredena vozila moze kupit prodse
Dio skripte:
if(strcmp(cmd, "/buyprods", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			new tmpcar = GetPlayerVehicleID(playerid);
			new compcost = 20;
			if(IsPlayerInRangeOfPoint(playerid, 70, 2468.4919,-2092.9902,13.5469))
			{
				if(IsATruck(tmpcar))
				{
					if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
					{
					    new amount;
					    tmp = strtok(cmdtext, idx);
						if(!strlen(tmp))
						{
							SendClientMessage(playerid, COLOR_GRAD1, "Korištenje: /buyprods [amount]");
							return 1;
						}
						amount = strval(tmp);
						if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "   Can't buy less then 1 Product or more then 500!"); return 1; }
						new check= PlayerHaul[tmpcar][pLoad] + amount;
						if(check > PlayerHaul[tmpcar][pCapasity])
						{
						    format(string, sizeof(string), "   You went over the Truck Products Carry Limit of %d, you currently carry %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
						    SendClientMessage(playerid, COLOR_GREY, string);
						    return 1;
						}
						new cost = amount*compcost;
						if(GetPlayerMoney(playerid) >= cost)
						{
							PlayerHaul[tmpcar][pLoad] += amount;
							format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							format(string, sizeof(string), "You bought %d Products for $%d.", amount,cost);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							SafeGivePlayerMoney(playerid,-cost);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							return 1;
						}
						else
						{
							format(string, sizeof(string), "You cant afford %d Products at $%d!", amount,cost);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							return 1;
						}
					}
					else
					{
							format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							return 1;
					}
				}
				else
				{
					SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Products.");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You are not in trucker place.");
				return 1;
			}
		}
		return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno): Evo IsATruck
public IsATruck(carid)
{
new m = GetVehicleModel(carid);
if(m == 403 || m == 406 || m == 408 || m == 414 || m == 443 || m == 456 || m == 455 || m == 498 || m == 499 || m == 514 || m == 515 || m == 609)
{
	return 1;
}