User name to real name
#1

Hi everybody!

I'm a noob in samp scripting, but i'm trying to learn it. I can send a client message to all if a player has been connected and I can also use a string to get the user name of the player in that message.

The new thing I'm trying no is to change that user name in their real name. This is the code I've got, and I'm sure it's wrong (because it doesn't work and the compiler gives a fault (warning 211: possibly unintended assignment) ) and I know i'm doing something wrong with the 'return-thing'.

Код:
public OnPlayerConnect(playerid)
{
        new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
    
if(name="Aegidje")
{
name="Aegide";
return 1;
}

if(name="Elietje28")
{
name="Elias";
return 1;
}

if(name="vandenboerseppe")
{
name="Seppe";
return 1;
}

if(name="SmacksCharlie")
{
name="Karel";
return 1;
}

if(name="stabar")
{
name="Steven";
return 1;
}

if(name="Supertoby28")
{
name="Aдron";
return 1;
}


    format(string, sizeof(string), "%s is ingelogd. (=has been connected)", name);
    SendClientMessageToAll(COLOR_GREEN, string);
So what I think what's happening is: there is made a string, called 'name' and the user name is stored in the string. Then, it checks if the string is one of the user names of my friends (Aegidje, Elietje28, vandenboerseppe,...). If that's right, the string changes to their real names. The next part is sending the message with the string.

Each tutorial I watch or read, I don't understand the return-part. Is their someone who can explain me what I did wrong and what those returns exactly are?

Thanks!

Elietje28
Reply


Messages In This Thread
User name to real name - by Elietje28 - 23.06.2013, 16:43
Re: User name to real name - by NoahF - 23.06.2013, 16:59
Re: User name to real name - by Elietje28 - 23.06.2013, 17:00
Re: User name to real name - by Swyft™ - 23.06.2013, 17:32
Re: User name to real name - by Elietje28 - 23.06.2013, 17:37
Re: User name to real name - by Swyft™ - 23.06.2013, 17:58
Re: User name to real name - by Basssiiie - 23.06.2013, 18:44
Re: User name to real name - by Swyft™ - 23.06.2013, 20:24
Re: User name to real name - by xxSwissxx - 24.06.2013, 05:58
Re: User name to real name - by Elietje28 - 24.06.2013, 13:41

Forum Jump:


Users browsing this thread: 4 Guest(s)