PDA

View Full Version : [AJUDA] Nome Roleplay


GabrielDias_Invision
30/11/2011, 12:28 PM
@RESOLVIDO

Cristhian
30/11/2011, 01:06 PM
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..

GabrielDias_Invision
30/11/2011, 01:30 PM
eu ja tinha tentado isso, da erro


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

Ricop522
30/11/2011, 01:59 PM
Testa aew cara.


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