Raised This Month: $12 Target: $400
 3% 

Solved Correct way to do this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode