stock randomString(strDest[], strLen = 10) {
while(strLen--)
strDest[strLen] = random(2) ? (random(26) + (random(2) ? \'a\' : \'A\')) : (random(10) + \'0\');
}
Használat:
new string[10];
randomString(string, 10);
Példa script (zcmd nélkül):
#include <a_samp>
stock randomString(strDest[], strLen = 10) {
while(strLen--)
strDest[strLen] = random(2) ? (random(26) + (random(2) ? \'a\' : \'A\')) : (random(10) + \'0\');
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, \"/rstring\", true))
{
new string[10];
randomString(string, 10);
SendClientMessage(playerid, -1, string);
return 1;
}
return 0;
}
Ha LUA-ban
Ne kérdezd idk :D
Ha más nyelvben
Írd le hogy miben és lehet tudok segíteni
Ha meg csak úgy:
https://www.random.org/strings/