SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 14/03/2012, 08:54 PM   #1
new121
Huge Clucker
 
Join Date: Feb 2012
Posts: 340
Reputation: 21
Default OnPlayerDisconnect

How do make it so when player leaves the server it says " david has left the server(leaving)" or if they crashed

david has left the server(Crash)

Thanks in advance.
__________________
http://skilladept.com

Team Speak IP: 176.31.241.180

Server IP: 176.31.241.180:1337

From scratch role play script with an active player base please check us out!
new121 is offline   Reply With Quote
Old 14/03/2012, 08:55 PM   #2
Jack_minka
Little Clucker
 
Join Date: Mar 2012
Posts: 1
Reputation: 0
Default Re: OnPlayerDisconnect

i want to be cop tell me how plz !
Jack_minka is offline   Reply With Quote
Old 14/03/2012, 09:01 PM   #3
Twisted_Insane
Gangsta
 
Twisted_Insane's Avatar
 
Join Date: Feb 2012
Posts: 976
Reputation: 95
Default Re: OnPlayerDisconnect

pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
    new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
    }
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}
__________________
Join the BEST Gangwar-server ever; Los Santos Gangwars!
http://forum.sa-mp.com/showthread.ph...42#post2235842
^ Read!

Any problems with ZCMD-commands? Simply PM me your topic or check out the tutorial(s) in my signature, more'll come soon!

Twisted_Insane is offline   Reply With Quote
Old 14/03/2012, 09:03 PM   #4
Alexy_Dramon
Big Clucker
 
Alexy_Dramon's Avatar
 
Join Date: Feb 2012
Posts: 126
Reputation: 2
Default Re: OnPlayerDisconnect

Code:
{
    new
    string[64],
    name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
	{
        case 0: format(string,sizeof string,"%s left the server. (Crashed)",name);
        case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
	}
    SendClientMessageToAll(0xFFFFFFAA,string);
	return 1;
}
__________________
If my help helped so Rep me!!!!

Server hosted be Hamachi
PM me if you wanna Join to my server!
Address: 5.84.197.75:7777
Alexy_Dramon is offline   Reply With Quote
Old 14/03/2012, 09:09 PM   #5
Twisted_Insane
Gangsta
 
Twisted_Insane's Avatar
 
Join Date: Feb 2012
Posts: 976
Reputation: 95
Default Re: OnPlayerDisconnect

Nice try for repeating my work...
__________________
Join the BEST Gangwar-server ever; Los Santos Gangwars!
http://forum.sa-mp.com/showthread.ph...42#post2235842
^ Read!

Any problems with ZCMD-commands? Simply PM me your topic or check out the tutorial(s) in my signature, more'll come soon!

Twisted_Insane is offline   Reply With Quote
Reply

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
Help me OnPlayerDisconnect kingchandio Help Archive 1 31/07/2011 09:44 AM
onplayerdisconnect pushingmyluck Help Archive 0 23/10/2010 11:04 AM
OnPlayerDisconnect Aleksandar_Zivanovci Help Archive 2 12/06/2010 09:58 PM
IRC OnPlayerDisconnect XRVX Help Archive 4 15/05/2010 09:33 AM
OnPlayerDisconnect Razvann Help Archive 2 17/03/2010 08:05 PM


All times are GMT. The time now is 05:45 AM.


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