COMMAND:search(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFFFF, "%s starts to look through the box.", GetPlayerName(playerid);
}
//under OnPlayerCommand
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/command1", true) == 0 || strcmp(cmd, "/command2", true) == 0 || strcmp(cmd, "/command3", true) == 0)
{
//Codes here
}
COMMAND:search(playerid, cmdtext[])
{
SendClientMessage(playerid, 0xFFFFFFFF, "%s starts to look through the box.", GetPlayerName(playerid);
}
COMMAND:iwilldothesameassearch(playerid, cmdtext[])
{
return cmd_search(playerid, cmdtext[]);
}
Like a /fish command.. you get like, 6 different fish, but it gives you one of the fish, at random? :S
|
//Somewhere at the beginning of your pawno script.
forward SendRandomMsgToAll();
//I got this BEHIND "public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])"
public SendRandomMsgToAll()
{
switch(random(4)) //4 is the number of how many random case's it can choose.
{
case 0: SendClientMessageToAll(COLOR_WHITE, "Hey YOU, Stop camping!! really not cool.");
case 1: SendClientMessageToAll(COLOR_WHITE, "Your hiding like a pussy, stand up and fight like a men should do!");
case 2: SendClientMessageToAll(COLOR_WHITE, "If you get caught on cheating you will most probably be banned, so do it unnoticed.");
case 3: SendClientMessageToAll(COLOR_WHITE, "Server closed the connection.");
//You can add more case's here but remember to change the switch(random(4)) number.
}
}
//And by calling the public use somewhere between a command or create a timer for it etc.
SendRandomMsgToAll();
CMD:search(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFFFF, "%s starts to look through the box.", GetPlayerName(playerid);
switch((random(6))
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 6:
}
return 1;
}
CMD:search(playerid, params[])
{
switch((random(6))
{
case 0: SendClientMessage(playerid, 0xFFFFFFFF, "message 1");
case 1: SendClientMessage(playerid, 0xFFFFFFFF, "message 2");
case 2: SendClientMessage(playerid, 0xFFFFFFFF, "message 3");
case 3: SendClientMessage(playerid, 0xFFFFFFFF, "message 4");
case 4: SendClientMessage(playerid, 0xFFFFFFFF, "message 5");
case 5: SendClientMessage(playerid, 0xFFFFFFFF, "message 6");
}
return 1;
}