on player login - 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: on player login (
/showthread.php?tid=121709)
on player login -
marine - 17.01.2010
i'm looking for a filterscript or a code that will send a message to players that are logged in that a player logged in.
Ex. *[Player's name] has just logged in*
Re: on player login -
kmzr - 18.01.2010
https://sampwiki.blast.hk/wiki/Creating_...Leave_Messages
Re: on player login -
marine - 18.01.2010
-snip-
Re: on player login -
deather - 18.01.2010
Код:
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
}
#endif
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0x0689ffff, string);
return 1;
}
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), "%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/banned)", pname);
}
SendClientMessageToAll(0x0689ffff, string);
return 1;
}
Worked good. Try this
Re: on player login -
Correlli - 18.01.2010
He's not looking for a join/leave message script, he's looking for a script that will send message to other players when someone logs in to his account.
Re: on player login -
[HiC]TheKiller - 18.01.2010
What register system are you using?
Re: on player login -
marine - 18.01.2010
I go it down to just this now though I still have one error that is the same.
Код:
public OnPlayerConnect(playerid) //Keeps saying error 029: invalid expression, assumed zero
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "%s has joined the server", plname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
public OnPlayerDisconnect(playerid) //Keeps saying error 029: invalid expression, assumed zero
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
{
format(string, sizeof(string), "%s has left the server. (Leaving)", plname);
}
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
the login/register system im using is this:
Код:
if (strcmp(cmd, "/login", true) ==0 || strcmp(cmd, "/l", true) ==0)
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "SERVER: You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "USAGE: (/l)ogin [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
//Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
//-----------Register---------------
if (strcmp(cmd, "/register", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "users/%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /register [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
//Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
Re: on player login -
marine - 18.01.2010
Anyone?
Re: on player login -
KnooL - 18.01.2010
don't bump within 12 hours. read the forum rules