[HELP]Random Cmd
#1

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

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

the name of the cmd don't maters give me the code
Reply
#4

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.
Reply
#5

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

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]);
Reply
#7

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]);
Reply
#8

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 3 Guest(s)