11.03.2009, 16:15
hmm, now i've got an other problem. on every truck, the messages work now when you hop in. but when you type /buyprod in truck0, it will work, if you type it in truck 1-4, it wont work. here is the piece of script:
i've got everything good defined, so the problem has to be in here..
Код:
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(10.0,playerid,-1834.4691, 129.1151, 15.1171))
return SendClientMessage(playerid, COLOR_RED, "You have to be at the truck station");
if(!IsPlayerInVehicle(playerid, truck[i]))
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.");
return AttachTrailerToVehicle(trailer[i],truck[i]);
}
return 0;
}

