SA-MP Forums Archive
Generating the same character.... (+REP) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Generating the same character.... (+REP) (/showthread.php?tid=605241)



Generating the same character.... (+REP) - Lirbo - 16.04.2016

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;} 



Re: Generating the same character.... (+REP) - Lirbo - 16.04.2016

sorry for early bump but i need it really quick


Re: Generating the same character.... (+REP) - Lirbo - 17.04.2016

bump