SA-MP Forums Archive
/random - 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: /random (/showthread.php?tid=296005)



/random - Cenation - 09.11.2011

Hi frnds,
i have created a command Random, now i want to make a function. When anyone type /random hi will get different thing on every type. like on 1st type - Cookie on 2nd time type teleport, bla bla bla. u got it..

can i get code ? thank u...


Re: /random - FarSe. - 09.11.2011

pawn Код:
if(strcmp( cmdtext, "/random", true ) == 0)
{
    if(gettime()-10>GetPVarInt(playerid,"RandomLimit"))//Player need to wait 10 seconds from last /random.
    {
        SetPVarInt(playerid,"RandomLimit",gettime());
        switch(random(10))
        {
            case 0:
            {
                //GivePlayerCookie(playerid);
                SetClientMessage(playerid,~0,"You Won a Cookie.");
            }
            case 1:
            {
                //SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
                SetClientMessage(playerid,~0,"You Won +1 Score.");
            }
            case 2:
            {
            ///
            }
            case 3:
            {
            ///
            }
            case 4:
            {
            ///
            }
            case 5:
            {
            ///
            }
            case 6:
            {
            ///
            }
            case 7:
            {
            ///
            }
            case 8:
            {
            ///
            }
            case 9:
            {
            ///
            }
        }
    }else SendClientMessage(playerid,~0,"Please wait...");
}



Re: /random - Cenation - 09.11.2011

Thank U...