[AJUDA] Nome Roleplay - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Nome Roleplay (
/showthread.php?tid=300407)
@RESOLVIDO -
GabrielDias_Invision - 30.11.2011
@RESOLVIDO
Re: [AJUDA] Nome Roleplay -
Cristhian - 30.11.2011
pawn Код:
stock IsARoleplayName(playerid)
{
new strg[24],underscore;
GetPlayerName(playerid, strg, 24);
if(strg[0] < 'A' || strg[0] > 'Z') return false;
for(new i = 1; i < 24; i++)
{
switch(strg[i])
{
case '\0':
{
if(i < 2) return false;
return true;
}
case 'a'..'z': continue;
case '_':
{
underscore++;
if(underscore == 2) return false;
i++;
if(strg[i] < 'AA' || strg[i] > 'Z') return false;
}
default: return false;
}
}
return true;
}
talvez resolva..
Re : [AJUDA] Nome Roleplay -
GabrielDias_Invision - 30.11.2011
eu ja tinha tentado isso, da erro
PHP код:
D:\GTA\Server\gamemodes\BVL.pwn(4030) : error: 027: invalid character constant
D:\GTA\Server\gamemodes\BVL.pwn(4030) : error: 017: undefined symbol "A"
D:\GTA\Server\gamemodes\BVL.pwn(4030) : error: 029: invalid expression, assumed zero
D:\GTA\Server\gamemodes\BVL.pwn(4030) : error fatal: 107: too many error messages on one line
Re: [AJUDA] Nome Roleplay -
Ricop522 - 30.11.2011
Testa aew cara.
pawn Код:
stock IsARoleplayName(playerid)
{
new strg[24];
GetPlayerName(playerid, strg, 24);
if(!strfind(sendername, "_", true)) return false;
for(new i = 1; i < 24; i++)
{
if(strg[i] >= 33 && strg[i] <= 64 || strg[i] >= 91 && strg[i] <= 96) return false;
}
return true;
}