SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 01/04/2009, 09:13 PM   #1
Shellegg
Huge Clucker
 
Join Date: Apr 2008
Posts: 282
Reputation: 0
Default Message to kicked player

So, my GM automatcly kick a player when he doesn't have a name like 1stName_LastName.
When some join the server with a nickname like "Shellegg" ht only see:

"Server closed the information."

How to send them a message telling them that they need a name with the format descripted above.

This is my actually "script"

pawn Code:
if(RPName(PlayerName(playerid),first,last))
    {
      .........
      .........
      .........
    }
    else
    {
      KickPlayer(playerid,"«Manalgas»","Inválid Name, Correct form: Name_Surname.");
    }
    return 1;
Shellegg is offline  
Old 01/04/2009, 09:15 PM   #2
FUNExtreme
Gangsta
 
Join Date: Mar 2008
Posts: 790
Reputation: 128
Default Re: Message to kicked player

Search the wiki for SendClientMessage and add the message before the Kickplayer line.
__________________

FUNExtreme is offline  
Old 01/04/2009, 09:32 PM   #3
Pyrokid
Huge Clucker
 
Join Date: May 2006
Posts: 482
Reputation: 0
Default Re: Message to kicked player

SendClientMessage(...);
Kick(...);

SendClientMessage must go before kick.
Pyrokid is offline  
Old 01/04/2009, 09:52 PM   #4
Shellegg
Huge Clucker
 
Join Date: Apr 2008
Posts: 282
Reputation: 0
Default Re: Message to kicked player

Thank you, tahat is what i need
Shellegg is offline  
Old 01/04/2009, 09:56 PM   #5
FUNExtreme
Gangsta
 
Join Date: Mar 2008
Posts: 790
Reputation: 128
Default Re: Message to kicked player

At your service
__________________

FUNExtreme is offline  
Old 01/04/2009, 10:13 PM   #6
Shellegg
Huge Clucker
 
Join Date: Apr 2008
Posts: 282
Reputation: 0
Default Re: Message to kicked player

pawn Code:
else
    {
      SendClientMessage(playerid, COLOR_ADMINCMD, "You have been kicked by «Manalgas» reason: you name must be Name_Surname");
      KickPlayer(playerid,"«Manalgas»","Inválid Name");
    }
    return 1;

Still not working..
Shellegg is offline  
Old 01/04/2009, 11:10 PM   #7
Mikep
High-roller
 
Join Date: Apr 2008
Posts: 1,042
Reputation: 10
Default Re: Message to kicked player

Use Kick(playerid);
Mikep is offline  
Old 01/04/2009, 11:14 PM   #8
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 2,628
Reputation: 136
Default Re: Message to kicked player

Or just let us see the function, and maybe we can fix it
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________


LarzI is offline  
Old 01/04/2009, 11:48 PM   #9
Norn
High-roller
 
Norn's Avatar
 
Join Date: Jul 2008
Location: Northern Ireland
Posts: 2,265
Reputation: 206
Default Re: Message to kicked player

Hes using my script, just replace the old functions with these.

pawn Code:
public KickPlayer(playerid,kickedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"%s has been kicked by %s, Reason: %s ",GetPlayerNameEx(playerid),kickedby,reason);
    SendClientMessageToAllEx(COLOR_ADMINCMD,string);
    KickLog(string);
    format(string,sizeof(string),"You have been kicked from the server, Reason: %s",reason);
    SendClientMessage(playerid,COLOR_ADMINCMD,string);
    return Kick(playerid);
}
public BanPlayerAccount(playerid,bannedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"%s has been Account-Banned by %s, Reason: %s ",GetPlayerNameEx(playerid),bannedby,reason);
    SendClientMessageToAllEx(COLOR_ADMINCMD,string);
    AccountBanLog(string);
    PlayerInfo[playerid][pBanned] = 1;
    OnPlayerDataSave(playerid);
    format(string,sizeof(string),"You have been account banned, Reason: %s",reason);
    SendClientMessage(playerid,COLOR_ADMINCMD,string);
    return Kick(playerid);
}
public BanPlayer(playerid,bannedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"%s has been banned by %s, Reason: %s ",GetPlayerNameEx(playerid),bannedby,reason);
    SendClientMessageToAllEx(COLOR_ADMINCMD,string);
    BanLog(string);
    format(string,sizeof(string),"You have been banned from the server, Reason: %s",reason);
    SendClientMessage(playerid,COLOR_ADMINCMD,string);
    return Ban(playerid);
}

I forgot to make it send them messages.
__________________
Pursuing other endeavours.

Skype: datinvictusguy
Norn is offline  
Old 02/04/2009, 12:08 AM   #10
Shellegg
Huge Clucker
 
Join Date: Apr 2008
Posts: 282
Reputation: 0
Default Re: Message to kicked player

how to define
pawn Code:
undefined symbol "SendClientMessageToAllEx"

xD
Shellegg is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
message about player Headshot1108 Help Archive 13 19/03/2010 11:07 PM
KICK AND BAN REASON DONT SHOWN TI KICKED/BANNED PLAYER WHY? HERE IS CMD buonggiorno Help Archive 1 14/12/2009 01:51 PM
[0.3 Bug] Player got kicked by SA:MP 0.3 due bug. Andom Help Archive 5 24/10/2009 04:48 AM
Welcome to [Player] - Welcome message help nickbugun Help Archive 2 15/04/2009 01:32 PM


All times are GMT. The time now is 04:40 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.