Welcome message.
#1

Hello!

I have a small issue with this code.

Basically, this is a welcome message, which shows at the player`s login.

The problem is that whenever the player login, the message displays twice, not once.
More than this, it displays when the player comes back from tabbed status or when admins finish spectating a player.

Here is my chat`s log:

Код:
[07:33:31] Connected to {B9C9BF}American Dream Roleplay | 0.3z

[07:33:37] 

[07:33:38] Welcome to American Dream Roleplay, {FF6347}Michael Morrison{FFFFFF} !

[07:33:38] Your statistics are:

[07:33:38] Playing hours: 4

[07:33:38] Helper level: 5

[07:33:38] V.I.P level: 5

[07:33:38] Developer level: 6

[07:33:38] Mapper level: 5

[07:33:38] Administrator level: 1338

[07:33:38] {348017}AdmLogin: Administrator Michael Morrison has logged in. (Adminstration Level : 1338)

[07:33:38] You are logged in as a famed player! 

[07:33:38] Welcome to American Dream Roleplay, {FF6347}Michael Morrison{FFFFFF} !

[07:33:38] Your statistics are:

[07:33:38] Playing hours: 4

[07:33:38] Helper level: 5

[07:33:38] V.I.P level: 5

[07:33:38] Developer level: 6

[07:33:38] Mapper level: 5

[07:33:38] Administrator level: 1338

[07:33:38] {348017}AdmLogin: Administrator Michael Morrison has logged in. (Adminstration Level : 1338)

[07:33:38] You are logged in as a famed player!
As you see above, the message is sent twice.


Here is the code:

pawn Код:
Spawned[playerid] = 1;
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,0);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,0);
    SetPlayerWeapons(playerid);
    SetPlayerSpawn(playerid);
    PlayerFixRadio(playerid);
    gPlayerSpawned[playerid] = 1;
    TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
    new string[128];
    // Welcome
    format(string, sizeof(string), "Welcome to American Dream Roleplay, {FF6347}%s{FFFFFF} !", RPN(playerid));
    SendClientMessage(playerid, COLOR_WHITE, string);
    // Stats
    format(string, sizeof(string), "Your statistics are:");
    SendClientMessage(playerid, COLOR_WHITE, string);
    // Player
    format(string, sizeof(string), "Playing hours: %d", PlayerInfo[playerid][pLevel]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    // Helper
    if(PlayerInfo[playerid][pHelper]){
    format(string, sizeof(string), "Helper level: %d", PlayerInfo[playerid][pHelper]);
    SendClientMessage(playerid, COLOR_WHITE, string);}
    // VIP
    if(PlayerInfo[playerid][pDonateRank]){    
    format(string, sizeof(string), "V.I.P level: %d", PlayerInfo[playerid][pDonateRank]);
    SendClientMessage(playerid, COLOR_WHITE, string);}     
    // Developer
    if(PlayerInfo[playerid][pDeveloper]){
    format(string, sizeof(string), "Developer level: %d", PlayerInfo[playerid][pDeveloper]);
    SendClientMessage(playerid, COLOR_WHITE, string);}
    // Mappers
    if(PlayerInfo[playerid][pMapper]){
    format(string, sizeof(string), "Mapper level: %d", PlayerInfo[playerid][pMapper]);
    SendClientMessage(playerid, COLOR_WHITE, string);}
    // Admin
    if(PlayerInfo[playerid][pAdmin]){
    format(string, sizeof(string), "Administrator level: %d", PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, COLOR_WHITE, string);}
    // Admin Messages
    if(PlayerInfo[playerid][pAdmin]){
    format(string, sizeof(string), "{348017}AdmLogin: Administrator %s has logged in. (Adminstration Level : %d)", RPN(playerid), PlayerInfo[playerid][pAdmin]);
    SendAdminMessage(COLOR_LIGHTBLUE, string);}
    // Famed Message
    if(PlayerInfo[playerid][pFamed]){
    format(string, sizeof(string), "You are logged in as a famed player! ", RPN(playerid), PlayerInfo[playerid][pFamed]);
    SendAdminMessage(COLOR_LIGHTBLUE, string);}
    // Welcome message
    format(string, sizeof(string), "{FFFF00}STAFF: Message.....");
Reply


Messages In This Thread
Welcome message. - by Michael B - 07.02.2015, 05:03
Re: Welcome message. - by Threshold - 07.02.2015, 05:32
Re: Welcome message. - by Naresh - 07.02.2015, 05:42
Re: Welcome message. - by Michael B - 07.02.2015, 05:46
Re: Welcome message. - by Ritzy2K - 07.02.2015, 06:02
Re: Welcome message. - by Ritzy2K - 07.02.2015, 06:04
Re: Welcome message. - by ZombieNest - 07.02.2015, 07:03
Re: Welcome message. - by Michael B - 07.02.2015, 08:42

Forum Jump:


Users browsing this thread: 3 Guest(s)