SA-MP Forums Archive
Disconnect message error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Disconnect message error (/showthread.php?tid=74306)



Disconnect message error - Packer5 - 21.04.2009

Hey all, I tried adding a D/C message to my script as my server doesnt have one. And I got this lovely error:

C:\Server\gfscript.pwn(3044) : error 017: undefined symbol "reason"

Info: Its a GF edit. Heres the D/C script I use:

Код:
}
  new pName[MAX_PLAYER_NAME], string[56];
  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);
  }
}



Re: Disconnect message error - StrickenKid - 21.04.2009

is it under onplayerdisconnect?


Re: Disconnect message error - Packer5 - 21.04.2009

Yep

Код:
public OnPlayerDisconnect(playerid)

{
  new pName[MAX_PLAYER_NAME], string[56];
  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;

//{



Re: Disconnect message error - MarkusJuntunen - 21.04.2009

Define "reason" -.-


Re: Disconnect message error - Packer5 - 21.04.2009

how?


Re: Disconnect message error - Redirect Left - 21.04.2009

change
pawn Код:
public OnPlayerDisconnect(playerid)
to
pawn Код:
public OnPlayerDisconnect(playerid,reason)



Re: Disconnect message error - MarkusJuntunen - 21.04.2009

try
Код:
public OnPlayerDisconnect(playerid, reason)
edit: guess i was a bit slow ^^,


Re: Disconnect message error - Packer5 - 21.04.2009

thanks guys works perfectly now


Re: Disconnect message error - Redirect Left - 21.04.2009

Quote:
Originally Posted by Packer5
thanks guys works perfectly now
your welcome.