OnPlayerDisconnect :'( - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDisconnect :'( (
/showthread.php?tid=529409)
OnPlayerDisconnect :'( -
kesarthakur - 02.08.2014
i added this at OnPlayerDisconnect:
pawn Код:
new str[256];
switch(reason)
{
case 0: format( str, sizeof(str), ""GREY"<"RED"-"GREY"> {%06x}%s(%d) {87CEFA}has disconnected "RED"(Crash){87CEFA}. "GREY"[%d/%d]", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, players_connected, GetMaxPlayers() );
case 1: format( str, sizeof(str), ""GREY"<"RED"-"GREY"> {%06x}%s(%d) {87CEFA}has disconnected "RED"(Quit){87CEFA}. "GREY"[%d/%d]", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, players_connected, GetMaxPlayers() );
case 2: format( str, sizeof(str), ""GREY"<"RED"-"GREY"> {%06x}%s(%d) {87CEFA}has disconnected "Red"(Kick/Ban){87CEFA}. "GREY"[%d/%d]", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, players_connected, GetMaxPlayers() );//this is line 1196
}
SendClientMessageToAll( -1, str );
and i am getting this errors

:
pawn Код:
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\gamemodes\usfMain.pwn(1196) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
please help me to solve this please
Re: OnPlayerDisconnect :'( -
GeekSiMo - 02.08.2014
Try This: +Rep if I helped you
pawn Код:
new str[256];
switch(reason)
{
case 0: format( str, sizeof(str), ""GREY"<"RED"-"GREY"> {%06x}%s(%d) {87CEFA}has disconnected "RED"(Crash){87CEFA}. "GREY"[%d/%d]", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, players_connected, GetMaxPlayers() );
case 1: format( str, sizeof(str), ""GREY"<"RED"-"GREY"> {%06x}%s(%d) {87CEFA}has disconnected "RED"(Quit){87CEFA}. "GREY"[%d/%d]", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, players_connected, GetMaxPlayers() );
case 2: format( str, sizeof(str), ""GREY"<"RED"-"GREY"> {%06x}%s(%d) {87CEFA}has disconnected "RED"(Kick/Ban){87CEFA}. "GREY"[%d/%d]", (GetPlayerColor(playerid) >>> 8), GetName( playerid ), playerid, players_connected, GetMaxPlayers() );//this is line 1196
}
SendClientMessageToAll( -1, str );
Re: OnPlayerDisconnect :'( -
kesarthakur - 02.08.2014
both are same anyhow
no use
Re: OnPlayerDisconnect :'( -
Threshold - 02.08.2014
Replace:
pawn Код:
has disconnected "Red"(Kick/Ban)
with:
pawn Код:
has disconnected "RED"(Kick/Ban)
Looks like you have mixed up 'RED' and 'Red' which are two different macros/definitions. One would be a text replacement in embedding form, and the other would be a hex value, you have accidentally swapped the two.
Re: OnPlayerDisconnect :'( -
kesarthakur - 02.08.2014
didnt notice anyhow thanks for the help
**/me blind :P