Generating the same character.... (+REP)
#1

Idk why but whenever I generate a code it's generating the same code for some reason...
PHP код:
stock randomcharbool:useDigits false ) {
    if( 
useDigits ) {
        if( 
random(1000)%2==)
            return 
48 random(10);
        else
            return (
random(1000)%2==0) ? (65 random(26)) : (97 random(26));
    } else
        return ( 
random(1000) %==) ? (65 random(26)) : (97 random(26));
}
CMD:publishcode(playerid,params[]){
LoggedCMD LAdminCMD
if(CodeExists) return MSG(playerid,C_RED,"[Error] {ff9999}/DeleteCode to delete the current unused code.");
new 
String[128],String2[24];
if(
sscanf(params,"sd",CodeType,CodeAmount)) return MSG(playerid,C_RED,"[Error] {ff9999}/PublishCode [Money/Materials/EnergyPills/Heroin/Ecstasy/Cocaine/Crack/Pot/EXP] [Amount]");
if(
CodeAmount<1) return MSG(playerid,C_RED,"[Error] {ff9999}Invalid amount.");
for(new 
0sizeof(RandomString); i++)
formatRandomStringsizeofRandomString ), "%s%c"RandomStringrandomchar());
MSGTA(C_NICE,"--------------------------------------------------------------------");
format(String,sizeof(String),"[Admin] %s has published a %s code!",GetName(playerid),CodeType);
MSGTA(0x4F87FFFF,String);
format(String2,sizeof(String2),"[CODE] %s",RandomString);
MSGTA(0x4F87FFFF,String2);
MSGTA(C_NOTE,"[TIP] /RedeemCode to redeem the code!");
MSGTA(C_NICE,"--------------------------------------------------------------------");
CodeExists true;
return 
1;} 
Reply
#2

sorry for early bump but i need it really quick
Reply
#3

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)