Jump to content

Question

Posted

Salut tuturor, am si eu un BUG la jobul de trucker. Daca dau /buyprods in masina de job imi da "SERVER: Unknown Command. Uitati ultimul rand:

Zg1XZCF.png

Daca dau /buyprods cand sunt pe jos imi zice asta. Uitati ultimul rand:

[img width=500 height=312] qqingFq.png

Daca dau /load in masina de job imi da asta. Priviti ce apare pe ecran:

[img width=500 height=312] iAAs8Cy.png

Iar daca dau /load cand sunt pe jos imi zice asta. La fel, ultimul rand:

[img width=500 height=312] N0cJTtr.png

Ma puteti ajuta va rog frumos?

3 answers to this question

Recommended Posts

Posted

Nu am ZCMD-uri cred ... cel putin la inceputul GM-ului nu am [pawn]#include <zcmd>[/pawn]. Uite comanda "/load" si "/buyprods": [pawn]if(strcmp(cmd, "/load", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

new tmpcar = GetPlayerVehicleID(playerid);

if((tmpcar == tcar) || (tmpcar == tcar1) || (tmpcar == tcar2) || (tmpcar == tcar3) || (tmpcar == tcar4)

              || (tmpcar == tcar5) || (tmpcar == tcar6) || (tmpcar == tcar7) || (tmpcar == tcar8) || (tmpcar == tcar9)

              || (tmpcar == tcar10) || (tmpcar == tcar11) || (tmpcar == tcar12))

{

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, 2814.7297,935.0300,10.9766) || PlayerToPoint(60.0, playerid, 2859.3765,910.4639,10.7500))

{

if(IsATruck(tmpcar))

{

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

{

    new amount;

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{FF66FF}Foloseste{FFFFFF}: /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;

}[/pawn]

Posted

Bugul se repara daca pui id-ul la masina in gm trebuie definit ! De exemplu la /buyprods sa fie

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

{

    if(IsPlayerConnected(playerid))

{

new tmpcar = GetPlayerVehicleID(playerid);

if(tmpcar < 707 || tmpcar > 715)

{

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) || PlayerToPoint(60.0, playerid, -1705.7233,14.0890,3.5547))

{

if(IsATruck(tmpcar))

{

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

{

    new amount;

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /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(tmpcar < 707 || tmpcar > 715)

{

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;

}

for(new i = 0; i < sizeof(BizzInfo); i++)

{

if (PlayerToPoint(10, playerid,BizzInfo[bEntranceX], BizzInfo[bEntranceY], BizzInfo[bEntranceZ]))

{

//printf("Found House :%d",i);

for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)

{

if(BizzInfo[bProducts] == BizzInfo[bMaxProducts])

{

GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);

format(string, sizeof(string), "Cash Earned $%d.", cashmade);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

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

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

return 1;

}

if(BizzInfo[bPriceProd] > BizzInfo[bTill])

{

GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);

format(string, sizeof(string), "Cash Earned $%d.", cashmade);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

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

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

return 1;

}

PlayerHaul[tmpcar][pLoad]--;

BizzInfo[bProducts]++;

cashmade = cashmade+BizzInfo[bPriceProd];

ConsumingMoney[playerid] = 1;

GivePlayerMoney(playerid,BizzInfo[bPriceProd]);

BizzInfo[bTill] -= BizzInfo[bPriceProd];

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

{

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

format(string, sizeof(string), "Cash Earned $%d.", cashmade);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

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

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

return 1;

}

}

OnPropUpdate();

return 1;

}

}

}

for(new i = 0; i < sizeof(SBizzInfo); i++)

{

if (PlayerToPoint(10, playerid,SBizzInfo[sbEntranceX], SBizzInfo[sbEntranceY], SBizzInfo[sbEntranceZ]))

{

//printf("Found House :%d",i);

for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)

{

if(SBizzInfo[sbProducts] == SBizzInfo[sbMaxProducts])

{

GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);

format(string, sizeof(string), "Cash Earned $%d.", cashmade);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

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

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

return 1;

}

if(SBizzInfo[sbPriceProd] > SBizzInfo[sbTill])

{

GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);

format(string, sizeof(string), "Cash Earned $%d.", cashmade);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

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

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

return 1;

}

PlayerHaul[tmpcar][pLoad]--;

SBizzInfo[sbProducts]++;

cashmade = cashmade+SBizzInfo[sbPriceProd];

ConsumingMoney[playerid] = 1;

GivePlayerMoney(playerid,SBizzInfo[sbPriceProd]);

SBizzInfo[sbTill] -= SBizzInfo[sbPriceProd];

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

{

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

format(string, sizeof(string), "Cash Earned $%d.", cashmade);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

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

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

return 1;

}

}

OnPropUpdate();

return 1;

}

}

GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);

return 1;

}[/pawn]

Sa fie ceva de genul peste tot

[pawn] new tmpcar = GetPlayerVehicleID(playerid);

if(tmpcar < 707 || tmpcar > 715)

{

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

return 1;

}[/pawn]

Defineste peste tot si se rezolva ! Succes ! < Id-ul masinilor il vezi in joc cu /dl >

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.