how to change John_Smiff name format for user - 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: how to change John_Smiff name format for user (
/showthread.php?tid=535148)
how to change John_Smiff name format for user -
semaj - 02.09.2014
Hello everyone am looking for a bit of help with this script
https://sampforum.blast.hk/showthread.php?tid=526143
What it is, the GM requires you to have the name format as (John_smiff) i would like it to be able to use what you like in a single name format (john) but not sure how to do so can anyone help me out on this
Thanks
Re: how to change John_Smiff name format for user -
IceBilizard - 02.09.2014
You must find out in script and remove it
pawn Код:
stock IsRPName(const name[], max_underscores = 1)
{
new underscores = 0;
if (name[0] < 'A' || name[0] > 'Z') return false; // first letter != capital
for(new i = 1; i < strlen(name); i++)
{
if(name[i] != '_' && (name[i] < 'A' || name[i] > 'Z') && (name[i] < 'a' || name[i] > 'z')) return false; // a-zA-Z_
if( (name[i] >= 'A' && name[i] <= 'Z') && (name[i - 1] != '_') ) return false; // unneeded capital letter
if(name[i] == '_')
{
underscores++;
if(underscores > max_underscores || i == strlen(name)) return false; // more than defined underline
if(name[i + 1] < 'A' || name[i + 1] > 'Z') return false; // no capital letter after underline
}
}
if (underscores == 0) return false; // no underline
return true;
}
then go on public OnPlayerConnect(playerid)
and remove
pawn Код:
if(!IsRPName(name, 1))
{
SendClientMessage(playerid, 0xDE5454FF, "You don't have a roleplaying name! Please reconnect using a name in Firstname_Lastname format!");
SendClientMessage(playerid, 0xDE5454FF, "Make sure the name you choose is realistic, one you would use in real life! (i.e. ''John_Smith'')");
SetTimerEx("DelayedKick", 450, false, "i", playerid);
return false;
}
Re: how to change John_Smiff name format for user -
semaj - 02.09.2014
getting loads of undefined symbol "GetPlayerRPName"
Re: how to change John_Smiff name format for user -
IceBilizard - 02.09.2014
In the script its a-lot of GetPlayerRPName so you have to change it with player name with GetPlayerName
Re: how to change John_Smiff name format for user -
semaj - 02.09.2014
hmm getting loads of warning 202: number of arguments does not match definition now :S