OnplayerConnect (Rep +)
#1

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
Reply
#2

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

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.
Reply
#4

i got a problem i connected but it said
Reply
#5

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.
Reply
#6

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 );

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)