Author Topic: how to add an ann welcome in my server with gups v16a  (Read 3479 times)

0 Members and 1 Guest are viewing this topic.

Offline [KiLLeR]hussen

  • Street Thug
  • *
  • Posts: 9
    • View Profile
how to add an ann welcome in my server with gups v16a
« on: January 28, 2011, 08:42:23 pm »
hello guys,
i wanna add a welcome script when someone joins my server
example: welcome to blablabla server....
help plz,
thnx for all :D

Offline Pawno

  • Street Thug
  • *
  • Posts: 15
    • View Profile
Re: how to add an ann welcome in my server with gups v16a
« Reply #1 on: January 28, 2011, 10:56:11 pm »
Put in. public OnPlayerConnect(playerid) GameTextForPlayer(playerid,"Welcome"); you can take the default color "pink" for others it is just you get this link > http://famp.ru/wiki/GameTextCodes example

public OnPlayerConnect(playerid)
{
   ServerInfo[0][Countx] = 3;
   SetWaterLevel(6.0);
   SetGamespeed(100);
   SetGravity(100);
   SetPlayerMoney(playerid,0);
    GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
    
    PlayerInfo[playerid][Spawned] = 0;
    new string[256];
   format(string,256,"** [%d] %s has joined the server.",playerid,gPlayers[playerid]);
   print(string);
   format(string,256,"3** [%d] %s has joined the server.",playerid,gPlayers[playerid]);
   SendToIRC(string);

   format(file, sizeof(file), USERS_FILE, gPlayers[playerid]);
   new loggedin, lluip[256], IP[256]; loggedin = dini_Int(file, "Login"), lluip = dini_Get(file, "Ip");
   if(dini_Exists(file)) {
       if (loggedin == 1 && CompariseIp(playerid) == 1) {
         new level, stats, nogoto, noloc, cash, szMsg[256];
         level = dini_Int(file, "Level");
         stats = dini_Int(file, "Stats");
         nogoto = dini_Int(file, "NoGoto");
         noloc = dini_Int(file, "NoLoc");
         cash = dini_Int(file, "Cash");
         GetPlayerIp(playerid,IP,256);

         PlayerInfo[playerid][Logged] = 1;
         PlayerInfo[playerid][Level] = level;
         PlayerInfo[playerid][Stats] = stats;
         PlayerInfo[playerid][NoGoto] = nogoto;
         PlayerInfo[playerid][NoLoc] = noloc;
                        GameTextForPlayer(playerid,"Welcome to blablabla server");
         SendClientMessage(playerid,COLOR_GREEN,"You have auto-loged in!");
         format(szMsg,sizeof(szMsg),"Nick:[ %s ] Level:[ %d ] Status:[ %s ]",gPlayers[playerid],level,StatusTag(level));
         SendClientMessage(playerid,COLOR_GREEN,szMsg);
         SetPlayerMoney(playerid,0);
         SetPlayerMoney(playerid,cash);
      }
      else {
         SendClientMessage(playerid, COLOR_GREEN, "Please login to this account!");
         SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c login [Password]");
         PlayerInfo[playerid][Logged] = 0;
      }
   }
   else {
                GameTextForPlayer(playerid,"Welcome to blablabla server");
      SendClientMessage(playerid, COLOR_GREEN, "Your nick is not registered. Please register to protect it!");
      SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c register [Password]");
      PlayerInfo[playerid][Logged] = 2;
      PlayerInfo[playerid][Stats] = 2;
   }
   return 1;
}

Offline Robd

  • Wiseguy
  • **
  • Posts: 67
    • View Profile
Re: how to add an ann welcome in my server with gups v16a
« Reply #2 on: January 28, 2011, 11:50:40 pm »
instead of doing it after IfDini exists you could just add it near setgrav just to have a less confusing script
Hello, this is Robd from the past.
If you are seeing this I have either posted something stupid, forgotten something, started a stupid topic, or a combination of the three.

Please forgive us for this mistake.

Regards, management

yazeen

  • Guest
Re: how to add an ann welcome in my server with gups v16a
« Reply #3 on: February 14, 2011, 06:18:53 pm »
simple

Code: [Select]
public OnPlayerConnect(playerid)
{
ServerInfo[0][Countx] = 3;
SetWaterLevel(6.0);
SetGamespeed(100);

on this line add this

public OnPlayerConnect(playerid)

Code: [Select]
public OnPlayerConnect(playerid)
{
    [color=red]GameTextForPlayer(playerid,"Welcome to EXTREME RPG!",5000,5);[/color]
ServerInfo[0][Countx] = 3;
SetWaterLevel(6.0);
SetGamespeed(100);

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: how to add an ann welcome in my server with gups v16a
« Reply #4 on: February 14, 2011, 10:21:10 pm »
Quote
public OnPlayerConnect(playerid)
{
    GameTextForPlayer(playerid,"Welcome to EXTREME RPG!",5000,5);
   ServerInfo[0][Countx] = 3;
   SetWaterLevel(6.0);
   SetGamespeed(100);

O_o at color


it should be

Quote
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"Welcome to my Server Name here",5000,5);
   ServerInfo[0][Countx] = 3;
   SetWaterLevel(6.0);
   SetGamespeed(100);
}

u have to add this
Quote
GameTextForPlayer(playerid,"Welcome to my Server Name here",5000,5);
Outdoor city server Administrator, FS server owner!

Offline Robd

  • Wiseguy
  • **
  • Posts: 67
    • View Profile
Re: how to add an ann welcome in my server with gups v16a
« Reply #5 on: February 15, 2011, 03:21:01 am »
To change color u can use the color codes on the wiki here
« Last Edit: February 15, 2011, 03:26:36 am by Robd »
Hello, this is Robd from the past.
If you are seeing this I have either posted something stupid, forgotten something, started a stupid topic, or a combination of the three.

Please forgive us for this mistake.

Regards, management

Offline [KiLLeR]hussen

  • Street Thug
  • *
  • Posts: 9
    • View Profile
Re: how to add an ann welcome in my server with gups v16a
« Reply #6 on: February 17, 2011, 05:11:33 pm »
thnx alll u really helped me alot :D