SA-MP Forums Archive
OnplayerConnect (Rep +) - 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: OnplayerConnect (Rep +) (/showthread.php?tid=379755)



OnplayerConnect (Rep +) - Geeboi_Mehdi - 22.09.2012

When Player Connects i want it to Send message to all the players telling them that a player has connected from Country that they connected so for example
Geeboi_Mehdi Has Join The Server From The United States


Re: OnplayerConnect (Rep +) - Squirrel - 22.09.2012

Take a look at this
https://sampforum.blast.hk/showthread.php?tid=337304


Re: OnplayerConnect (Rep +) - HDFord - 22.09.2012

Ok. First you have to save the country of the player when the player register. I dont know if you can get the country in any way without tracing the IP in a very advanced way.
The register thing is the easyest i think.
So.
pawn Код:
public OnPlayerConnect(playerid)
{
    new string1, name[MAX_PLAYER_NAME];
    INI:mine[info](name[], value[])//Just a example using y_ini
    {
        INI_Int("country", gcountry);
    }
    format(string1,sizeof(string1),"%d has joined the server from %i",GetPlayerName(playerid,name,sizeof(name),gcountry);
    SendClientMessageToAll(0xFFFFFF,string1);
    return 1;
}
This is a very bad example, i know. I dont know what saving system you're using. I dont know if i scripted this right since i've been away from scripting a long time now. Try to use it.


Re: OnplayerConnect (Rep +) - Geeboi_Mehdi - 22.09.2012

i got a problem i connected but it said



Re: OnplayerConnect (Rep +) - Geeboi_Mehdi - 22.09.2012

HD Ford I tryed Yours Look What Heppend
pawn Код:
C:\Documents and Settings\Owner\Desktop\Pilots Life\gamemodes\PILOT.pwn(56) : error 017: undefined symbol "mine"
C:\Documents and Settings\Owner\Desktop\Pilots Life\gamemodes\PILOT.pwn(56) : error 017: undefined symbol "info"
C:\Documents and Settings\Owner\Desktop\Pilots Life\gamemodes\PILOT.pwn(56) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\Pilots Life\gamemodes\PILOT.pwn(56) : 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.



Re: OnplayerConnect (Rep +) - clarencecuzz - 23.09.2012

Change
pawn Код:
public OnRetrieveIpLocation(playerid, country[])
{

    new
        szStr[ 64 ];

    GetPlayerName( playerid, szStr, MAX_PLAYER_NAME );

    format( szStr, sizeof( szStr ), "<SERVER> Welcome %s to the server. From %s", szStr, country );

    SendClientMessageToAll( -1, szStr );

}
To:
pawn Код:
public OnRetrieveIpLocation(playerid, country[])
{

    new
        szStr[ 145 ];

    GetPlayerName( playerid, szStr, MAX_PLAYER_NAME );

    format( szStr, sizeof( szStr ), "<SERVER> Welcome %s to the server. From %s", szStr, country );

    SendClientMessageToAll( -1, szStr );

}