Thread: [Solved] Correct way to do this?
View Single Post
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 03-10-2018 , 08:13   Correct way to do this?
Reply With Quote #1

You cease amxx scripting for months and already forget a lot...

I've tried different ways that I already forgot and that take up more lines and still don't give the result I want. Here's a code that generates a serial code'ish code.

PHP Code:
new const gSChars[][] = {"AKA""AKB""AKC"};

public 
CmdGenSC(id)
{
    new 
SCode[20];
    
    
format(SCodecharsmax(SCode), 
        
"^x04Generation:^x03 %s%d/%d%/%d/%d"
        
gSChars[random_num(0charsmax(gSChars))], 
        
random_num(09), 
        
random_num(100999), 
        
random_num(1099), 
        
random_num(1000099999)
    );
    
    
ColorChat(idGREY"%s"SCode);
    
    return 
PLUGIN_CONTINUE;

What it should print: "Generation: AKA5/342/23/17063" (numbers are randomly generated as you can tell from the code)

What it prints: "Generation: A"

Don't judge

Last edited by redivcram; 03-20-2018 at 11:04.
redivcram is offline