Jump to content

Question

Posted

Salut Sa:Mp.ro am si eu problema zic eu cu jobul trucker... Problema este ca dupa ce ma urc in tir nu apar alea trei load,buyprod si sellprob .. gamemodu este gf  :smiley:  si daca dau eu buyprod etc imi apare un text.. vil voi arata in urmatoarea poza de mai jos: tir.jpg

screen shot  P.S.(jobul trucker este aproape de benzinaria aia de langa ferma)  [pawn]}

if(IsATruck(newcar))

{

format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

SendClientMessage(playerid, COLOR_WHITE, "INFO: You can deliver Products to Businesses.");

SendClientMessage(playerid, COLOR_WHITE, "INFO: Commands are /load /buyprods /sellprods");

}[/pawn]  [pawn]if(strcmp(cmd, "/load", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

new tmpcar = GetPlayerVehicleID(playerid);

if(tmpcar < 186 || tmpcar > 189)

{

GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1);

return 1;

}

format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

}

return 1;

}

if(strcmp(cmd, "/buyprods", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

new tmpcar = GetPlayerVehicleID(playerid);

new compcost = 50;

if(PlayerToPoint(60.0, playerid, 2787.8,-2436.3,13.7))

{

if(IsATruck(tmpcar))

{

if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])

{

    new amount;

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /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);

GivePlayerMoney(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;

}

}

}

return 1;

}

if(strcmp(cmd, "/sellprods", true) == 0)

{

    new cashmade;

    new tmpcar;

    if(IsPlayerConnected(playerid))

{

tmpcar = GetPlayerVehicleID(playerid);

if(!IsATruck(tmpcar))

{

GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1);

return 1;

}

if(PlayerHaul[tmpcar][pLoad] == 0)

{

GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);

format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

return 1;[/pawn]  Si app castigul la jobul trucker cum il cresc ?

3 answers to this question

Recommended Posts

Posted

[pawn]GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1);[/pawn]

Codul care lai dat tu lam incercat la mine si la fel mai zis si la mine , eh uite ce am facut eu ca sa mearga [pawn]GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 0);[/pawn] am modificat din 1 in 0 .

Incearca si tu asa ceva , si vezi tot asa iti da .

Invat ca sa Invat.

Posted

Vezi ce id-uri au camioanele

si modificale aici [pawn]if(tmpcar < 186 || tmpcar > 189)[/pawn]

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Rezolvat! Multumesc!!  :D (am facut si eu o cerere la sectiunea cerere script va rog sa va uitati)  Si o intrebare cum as putea sa modific pretul pe care il ei la sellprods?

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.