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..
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...");
}