23.06.2013, 16:43
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'.
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
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);
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