SA-MP Forums Archive
[SOLVED] SAMP Reason - 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: [SOLVED] SAMP Reason (/showthread.php?tid=106416)



[SOLVED] SAMP Reason - Nameless303 - 03.11.2009

I've got the following error in my leave message thing...

ERROR:
Код:
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(342) : error 017: undefined symbol "reason"
CODE:
Код:
public OnPlayerDisconnect(playerid)
{
  TextDrawHideForPlayer(playerid,TextWebsite);
	TextDrawHideForPlayer(playerid,TextName);
	
 	new pName[MAX_PLAYER_NAME], string[56];
  GetPlayerName(playerid, pName, sizeof(pName));
  switch(reason)
  {
    case 0: format(string, sizeof(string), ">> %s has left World War (Lost Connection)", pName);
    case 1: format(string, sizeof(string), ">> %s has left World War (Leaving)", pName);
    case 2: format(string, sizeof(string), ">> %s has left World War (Kicked)", pName);
  }
  SendClientMessageToAll(COLOR_ORANGE, string);
  
	return 1;
}
Please Help


Re: [HELP] SAMP Reason - KevKo95 - 03.11.2009

public OnPlayerDisconnect(playerid,reason)

Use the line above I believe.


Re: [HELP] SAMP Reason - Ibanez - 03.11.2009

Just do what Kevin said.

(here it is if you dont know what he is talking about)
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  TextDrawHideForPlayer(playerid,TextWebsite);
  TextDrawHideForPlayer(playerid,TextName);
   
  new pName[MAX_PLAYER_NAME], string[56];
  GetPlayerName(playerid, pName, sizeof(pName));
  switch(reason)
  {
    case 0: format(string, sizeof(string), ">> %s has left World War (Lost Connection)", pName);
    case 1: format(string, sizeof(string), ">> %s has left World War (Leaving)", pName);
    case 2: format(string, sizeof(string), ">> %s has left World War (Kicked)", pName);
  }
  SendClientMessageToAll(COLOR_ORANGE, string);
  return 1;
}



Re: [HELP] SAMP Reason - Nameless303 - 03.11.2009

Quote:
Originally Posted by [RP
Shogun ]
Just do what Kevin said.

(here it is if you dont know what he is talking about)
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  TextDrawHideForPlayer(playerid,TextWebsite);
  TextDrawHideForPlayer(playerid,TextName);
   
  new pName[MAX_PLAYER_NAME], string[56];
  GetPlayerName(playerid, pName, sizeof(pName));
  switch(reason)
  {
    case 0: format(string, sizeof(string), ">> %s has left World War (Lost Connection)", pName);
    case 1: format(string, sizeof(string), ">> %s has left World War (Leaving)", pName);
    case 2: format(string, sizeof(string), ">> %s has left World War (Kicked)", pName);
  }
  SendClientMessageToAll(COLOR_ORANGE, string);
  return 1;
}
Ye, it worked (:
Thank you both!

Ps; I did know what he was talking about *Proud*