how to change the player's name on spawn?
#1

Well i want to make something like, we got respect so when player spawns it will change his name to 00_[SN]Wallen for example, just adds 00_ which are his total respect points (pInfo[playerid][Respect]). I've already checked samp forums and found the function "SetPlayerName" but i can't use the format and i can't add the respect points before the player's nickname like i stated before. Any helps?
Reply
#2

this would help you..
Reply
#3

PHP код:
public OnPlayerSpawn(playerid)
{
    new 
pName[MAX_PLAYER_NAME+1];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
strins(pName"%d_"pInfo[playerid][pRespect]);
    
SetPlayerName(playeridpName);

Not sure if it works, took it from here
Reply
#4

Quote:
Originally Posted by willbedie
Посмотреть сообщение
PHP код:
public OnPlayerSpawn(playerid)
{
    new 
pName[MAX_PLAYER_NAME+1];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
strins(pName"%d_"pInfo[playerid][pRespect]);
    
SetPlayerName(playeridpName);

Not sure if it works, took it from here
Stop feeding people in mouth to get reps! Try to make them learn..
Reply
#5

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Stop feeding people in mouth to get reps! Try to make them learn..
I don't care for reps lmao i just want to help people, if i cared for reps i would make a lot of filtersciprts or post shit everyday, just fuck off.
Reply
#6

Quote:
Originally Posted by willbedie
Посмотреть сообщение
I don't care for reps lmao i just want to help people, if i cared for reps i would make a lot of filtersciprts or post shit everyday, just fuck off.
You aren't helping people like that, retarded it might gelp him now, but won't help him in future, fuck sakes.
Reply
#7

Oh yeah but anyway thanks for the help, i know how to use formats so strins is somehow like these, dont make a drama over this xD
Reply
#8

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
You aren't helping people like that, retarded it might gelp him now, but won't help him in future, fuck sakes.
That's just a small and easy code, how am i supposed to say it to them? Just stop quoting me, i don't like to talk to you bye
Reply
#9

I've tried do what you said, and yeah its not even adding anything before my name.

PHP код:
    new pName[MAX_PLAYER_NAME+1];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
strins(pName"%i_"pInfo[playerid][Respect]);
    
SetPlayerName(playeridpName); 
Reply
#10

for first, you have to save player's real name or just filter it.
when player receives or gives point, just add the name changing script.
for example, let's start with name saving.

at the top we're adding a name variable, like this new RealName[MAX_PLAYERS];
than we're saving a name as a variable, when a player connects
PHP код:
OnPlayerConnect(playerid)
{
    
GetPlayerName(playerid,RealName[playerid],28); 
so we have a real name now.
okay now we need to change a player's name when he receives or losts a points.
PHP код:
new name[28];
format(name,28,"%d_%s",pInfo[playerid][pRespect],RealName[playerid]);
SetPlayerName(playerid,name); 
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)