connect and exit command? -
Demon4511 - 24.08.2013
i want to know how to make a command that when a player connects it says "playerid just connected"
and "playerid just disconnected" but whenever i do this:
public OnPlayerConnect(playerid)
{
SendClientMessageToAll(0xFFFFFFFF, "playerid just connected!!!");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SendClientMessageToAll(0xFFFFFFFF, "playerid just disconnected!!!");
return 1;
}
it says "playerid" not there acctual id!!!
please help
Re: connect and exit command? -
Tuntun - 24.08.2013
You have to use string and %s also %d
Re: connect and exit command? -
Giroud12 - 24.08.2013
Which One?
pawn Код:
Player [ID] has connected
Or
pawn Код:
[Playername] has connected
Re: connect and exit command? -
Demon4511 - 24.08.2013
Quote:
Originally Posted by Tuntun
You have to use string and %s also %d
|
how would i do that? (sorry im not very good at this)
EDIT: how do i put code in box things?
Re: connect and exit command? -
Giroud12 - 24.08.2013
pawn Код:
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME],str[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(str,sizeof(str), "* %s just connected to the server *", pname);
SendClientMessageToAll(/*yourcolourhere*/, str);
return 1;
}
Re: connect and exit command? -
Demon4511 - 24.08.2013
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME],str[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(str,sizeof(str), "* %s just connected to the server *", pname);
SendClientMessageToAll("00C940", str);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME],str[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(str,sizeof(str), "* %s just disconnected to the server *", pname);
SendClientMessageToAll("00C940", str);
return 1;
}
this doesent work
Re: connect and exit command? -
Giroud12 - 24.08.2013
pawn Код:
#include <a_samp>
#define BLUE 0x0000FFFF
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME],str[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(str,sizeof(str), "* %s just connected to the server *", pname);
SendClientMessageToAll(BLUE, str);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME],str[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(str,sizeof(str), "* %s just disconnected to the server *", pname);
SendClientMessageToAll(BLUE, str);
return 1;
}
Re: connect and exit command? -
Demon4511 - 24.08.2013
sorry to bother you again but i get
error 017: undefined symbol "BLUE"
Re: connect and exit command? -
Demon4511 - 24.08.2013
and also would i be able to do the same when someone dies?
Re: connect and exit command? -
Giroud12 - 24.08.2013
Yup