Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: [KiLLeR]hussen on January 28, 2011, 06:42:23 PM

Title: how to add an ann welcome in my server with gups v16a
Post by: [KiLLeR]hussen on January 28, 2011, 06: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
Title: Re: how to add an ann welcome in my server with gups v16a
Post by: Pawno on January 28, 2011, 08: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;
}
Title: Re: how to add an ann welcome in my server with gups v16a
Post by: Robd on January 28, 2011, 09:50:40 PM
instead of doing it after IfDini exists you could just add it near setgrav just to have a less confusing script
Title: Re: how to add an ann welcome in my server with gups v16a
Post by: yazeen on February 14, 2011, 04:18:53 PM
simple

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


on this line add this

public OnPlayerConnect(playerid)

public OnPlayerConnect(playerid)
{
    [color=red]GameTextForPlayer(playerid,"Welcome to EXTREME RPG!",5000,5);[/color]
ServerInfo[0][Countx] = 3;
SetWaterLevel(6.0);
SetGamespeed(100);
Title: Re: how to add an ann welcome in my server with gups v16a
Post by: BIG[H] on February 14, 2011, 08:21:10 PM
Quotepublic 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

Quotepublic 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);
Title: Re: how to add an ann welcome in my server with gups v16a
Post by: Robd on February 15, 2011, 01:21:01 AM
To change color u can use the color codes on the wiki here (http://adf.ly/ViH4)
Title: Re: how to add an ann welcome in my server with gups v16a
Post by: [KiLLeR]hussen on February 17, 2011, 03:11:33 PM
thnx alll u really helped me alot :D