16.03.2009, 20:37
hello, i have been working on my truck job and i've got a weird error. when i do /buyprod in truck 1, it sais i have to be in a truck. when i am in truck 2, it sais i bought a trailer and it adds a trailer to truck 1.... i want to have it like, truck 1: trailer 1, truck 2: trailer to, etc. this is my script:
further i have this:
and the trucks identified of course 
could anyone help me with it??..
Код:
if(!strcmp("/buyprod", cmdtext, true,9))
for(new i; i<sizeof(truck); i++)
{
if(GetPlayerMoney(playerid)<=499)
return SendClientMessage(playerid,COLOR_RED,"You don't have $500");
if(!PlayerToPoint(30.0,playerid,-1834.4691, 129.1151, 15.1171))
return SendClientMessage(playerid, COLOR_RED, "You have to be at the truck loadstation");
if(!IsPlayerInVehicle(playerid, truck[1]))
return SendClientMessage(playerid, COLOR_RED, "You have to be in a truck!");
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid, COLOR_GREEN, "You have bought products for $500.");
CP1truckerjob = CreateCheckpoint(-1866.2645, 1409.7406, 7.7822, 10.0, 9999.9, "CP1truckerjob",true);
return AttachTrailerToVehicle(trailer[i],truck[i]);
}
Код:
new truck[5]; new trailer[5];

could anyone help me with it??..

