Random message
#1

Hello im making a simple script who gives random messages like:

i wanna make /check ID

so every 3 times it shows UNVALID

like /check ID: ----VALID
/CHECK ID --- VALID
/CHECK ID----VALID
/CHECK ID...UNVALID

I mean not always valid but sometimes it says unvalid, i just need to know how to randomize
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/check"))
{
    if(random(2) == 0) SendClientMessage(playerid, -1, "VALID");
    else SendClientMessage(playerid, -1, "UNVALID");
    return 1;
}
Reply
#3

Why do you want to do that?
Reply
#4

uh do somert like this

Quote:

//add to top of script
new unvalid;

//add under onplayer command.
if (strcmp("/check", cmdtext, true, 10) == 0)
{
if(unvalid[playerid] <= 2) {
unvalid = unvalid+1;
SendClientMessage(playerid, blue,"Valid");
}
else {
unvalid = 0;
SendClientMessage(playerid, red, "Unvalid");
}
return 1;
}

Reply
#5

pawn Код:
////Frisk System
CMD:checkid(playerid, params[])
{
    new ID;
    if (sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /Checkid [ID]");
    new playername[24];
    new string[128];
        for (new i=0;i<13;i++)
        {
        SendClientMessage(playerid, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
            GetPlayerName(ID, playername,sizeof(playername));
            format(string,sizeof(string),"Name: %s ", playername);
            SendClientMessage(playerid, COLOR_GREY, string);
            if(random(8) == 0) SendClientMessage(playerid, COLOR_GREY, "License Status: VALID");
            else SendClientMessage(playerid, -1, "License Status: UNVALID");
            SendClientMessage(playerid, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
        }
    return 1;
}
It spams the chat
Reply
#6

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Why do you want to do that?
i think he wants to do like the example of : /engine system

if /engine ; so the engine can start or doesn't start
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)