SA-MP Forums Archive
[HELP]Random Cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]Random Cmd (/showthread.php?tid=287037)



[HELP]Random Cmd - mayk - 01.10.2011

how to create a command /otvorisef and random GiveMoney... please tell me


Re: [HELP]Random Cmd - Kingunit - 01.10.2011

What you exactly mean with /otvorisis or whatever it's called.


Re: [HELP]Random Cmd - mayk - 01.10.2011

the name of the cmd don't maters give me the code


Re: [HELP]Random Cmd - Kingunit - 01.10.2011

Quote:
Originally Posted by mayk
Посмотреть сообщение
the name of the cmd don't maters give me the code
oh wait, misunderstood. I tought you meant /otvorise and /givemoney.

pawn Код:
CMD:givemoney(playerid, params[])
{
    if (!IsPlayerAdmin(playerid)) return SendClientMessage(byplayerid, 0xFF0000FF, "Only admins can use this command!");
    {
        new
            playerid,
            amount;
        if (!sscanf(params, "ui", playerid, amount)) return SendClientMessage(byplayerid, 0xFFFFFFFF, "Usage: /givemoney <player ID/name> <amount>");
        {
            if (playerid = INVALID_PLAYER_ID) return  SendClientMessage(byplayerid, 0xFF0000FF, "Error: no such player");
            {
                new
                    message[40];
                   
                GivePlayerMoney(playerid, amount);
                format(message, sizeof(message), "You got $%d from admin!", amount);
                SendClientMessage(playerid, 0x00FF00FF, message);
            }
        }
    }
    return 1;
}
And don't be so bitchy.


Re: [HELP]Random Cmd - mayk - 01.10.2011

LOL,Y NEED A CMD WITH RANDOM LIKE THIS YOU WROTE /otvorisef AND YOU GET 1000$-2000$-1500$-3000$ DO YOU NOW RANDOM ?


Re: [HELP]Random Cmd - Slake - 01.10.2011

global variable
new SELLCAR1[] = { 600, 671, 689, 571, 861, 751, 1267, 678, 874, 698, 1000 };

in command

new rand = random(sizeof(SELLCAR1));
format(string, sizeof(string), "Your %d$, cash.", SELLCAR1[rand]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerCash(playerid, SELLCAR1[rand]);


Re: [HELP]Random Cmd - mayk - 01.10.2011

where to put
new SELLCAR1[] = { 600, 671, 689, 571, 861, 751, 1267, 678, 874, 698, 1000 };
a example cmd with this "/sellcar
new rand = random(sizeof(SELLCAR1));
format(string, sizeof(string), "Your %d$, cash.", SELLCAR1[rand]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerCash(playerid, SELLCAR1[rand]);


Re: [HELP]Random Cmd - DRIFT_HUNTER - 01.10.2011

Evo brate
pawn Код:
CMD:otvorisef(playerid, params[])
{
    new randommoney= 1000+random(5000);
    GivePlayerMoney(playerid, randommoney);
    return 1;
}



Re: [HELP]Random Cmd - mayk - 01.10.2011

thanks brate,how to set a timer the player will spam this command 10 Times,no more to say The Bank Is robbed And All the money are GONE,run away the police is tracking you xD plz


Re: [HELP]Random Cmd - Kingunit - 01.10.2011

Goto the request thread. And don't be so bitchy.