Jump to content

Recommended Posts

Posted

Cum ar trebuii sa fac sa aleaga un numar dintre acestea imi da eroare la linia new rand ... tag mismatch

new number[2][1] =
{
{0},
{5}
};
CMD:multyply(playerid,params[])
{
new amount, money = GetPlayerMoney(playerid), numar, string[128];
if(sscanf(params,"ii",amount,numar)) return SendClientMessage(playerid, COLOR_PINK, "Syntax:/multyply <amount> <number(0 or 5)>");
if(amount < money && amount == 0)return SendClientMessage(playerid, COLOR_PINK, "Invalid amount!");
    new rand = random(number[0]);
    if(numar == rand)
    {
        GivePlayerMoney(playerid, amount);
      format(string,sizeof(string),"(+)Ai dublat banii tai !");
      SendClientMessage(playerid, COLOR_GREEN, string);
    }
    if(numar != rand)
    {
     GivePlayerMoney(playerid, -amount);
     format(string,sizeof(string),"(-)Ai pierdut banii pe care ai pariat!");
     SendClientMessage(playerid, COLOR_RED, string);
    }
    return 1;
}
Posted (edited)

De ce ai pus un array 2D, adica number[2][1]? Ai putea face si mai simplu

    new rand = random(999);
    if(numar == rand)
    {
      GivePlayerMoney(playerid, amount);
      format(string,sizeof(string),"(+)Ai dublat banii tai !");
      SendClientMessage(playerid, COLOR_GREEN, string);
    }
    if(numar != rand)
    {
      GivePlayerMoney(playerid, -amount);
      format(string,sizeof(string),"(-)Ai pierdut banii pe care ai pariat!");
      SendClientMessage(playerid, COLOR_RED, string);
    }

Nu prea are logica nici codul asta al tau... dar ti-l las asa.

//pune alt numar in loc de 999

Edited by Un4m3d_Hokage

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.

moduri samp