Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: [KiLLeR]hussen 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
-
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;
}
-
instead of doing it after IfDini exists you could just add it near setgrav just to have a less confusing script
-
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);
-
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
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
GameTextForPlayer(playerid,"Welcome to my Server Name here",5000,5);
-
To change color u can use the color codes on the wiki here (http://adf.ly/ViH4)
-
thnx alll u really helped me alot :D