Problem OnPlayerDisconnect
#1

Dosent appear in chat... why ?

OnPlayerDisconnect:

Quote:

switch(reason)
{
case 0: format(String, sizeof String, "%s (ID:%d) Quit (Crash)", NameEx(playerid), playerid);
case 1: format(String, sizeof String, "%s (ID:%d) Quit (leaving)", NameEx(playerid), playerid);
case 2:
{
format(String, sizeof String, "%s (ID:%d) quit (kick/Ban)", NameEx(playerid), playerid);
PlayCrimeReportForPlayer(playerid, playerid, 3);
}
}
SendClientMessageToAll(-1, String);

Stock:

Quote:

stock NameEx(playerid)
{
new
Name[24];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}

Reply
#2

Replace with This :

pawn Код:
new pName[MAX_PLAYER_NAME];
    new string[566];
    GetPlayerName(playerid, pName, sizeof(pName));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "{828282}===> %s Leaving The Server [ Connection Problem / Crash ] <===", pName);
        case 1: format(string, sizeof(string), "{828282}===> %s Leaving The Server [ Leaving ] <===", pName);
        case 2: format(string, sizeof(string), "{828282}===> %s Leaving The Server [ Kicked / Banned ] <===", pName);
    }
    SendClientMessageToAll(0xBBC8CBAA, string);
Reply
#3

Resolve to my code...
Reply
#4

define "String"
Код:
new String[50];
Under OnPlayerDisconnect.
Reply
#5

I have already defined the string
Reply
#6

What is wrong, does not appear in the chat?
Reply
#7

does not appear in the chat, yes
Reply
#8

help ?
Reply
#9

pawn Код:
switch(reason)
{
case 0: format(String, sizeof String, "%s (ID:%d) Quit (Crash)", NameEx(playerid), playerid);
case 1: format(String, sizeof String, "%s (ID:%d) Quit (leaving)", NameEx(playerid), playerid);
case 2: format(String, sizeof String, "%s (ID:%d) quit (kick/Ban)", NameEx(playerid), playerid);
PlayCrimeReportForPlayer(playerid, playerid, 3);
}
SendClientMessageToAll(-1, String);
Try So who knows.
Reply
#10

This will work for sure:

pawn Код:
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), "* Player %s has left the server! (Timeout) *", pname);
            case 1: format(string, sizeof(string), "* Player %s has left the server! (Leaving) *", pname);
            case 2: format(string, sizeof(string), "* Player %s has left the server! (Kicked/Banned) *", pname);
        }
        SendClientMessageToAll(0xAAAAAAAA, string);
// rest of your callback here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)