Jump to content
  • 0

[0.3c] Mesaj la conectare player


meoro

Question

Salutare!

Incerc de ceve vreme sa fac o chestie si tot nu reusesc... Pentru voi cred ca e usor dar eu fiind incepator...

Nu stiu cum sa adaug acel mesaj cand un player intra pe server :

%s a intrat pe server !
%s a iesit de pe server !
Multumesc EDIT: Asa arata in gm dar pe server nu arata:
public OnPlayerConnect(playerid)
{
	HaveTicket[playerid] = 0;
	ConnectPlayer(playerid);
	GameTextForPlayer(playerid," Nume server ",5000,5);
	SetPlayerScore(playerid, GetPlayerScore(playerid) + 100);
	SetPlayerArmour(playerid,1000);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		TextDrawShowForPlayer(i, Text:Clock[i]);
	}
	HealthBar[playerid] = TextDrawCreate(549.000000,52.000000,"..........");
	TextDrawAlignment(HealthBar[playerid],1);
	TextDrawBackgroundColor(HealthBar[playerid],0x00ff00ff);
	TextDrawFont(HealthBar[playerid],3);
	TextDrawLetterSize(HealthBar[playerid],0.569999,2.549999);
	TextDrawColor(HealthBar[playerid],0x00ff0033);
	TextDrawSetOutline(HealthBar[playerid],1);
	TextDrawSetProportional(HealthBar[playerid],1);
	TextDrawSetShadow(HealthBar[playerid],1);

	TextDrawShowForPlayer(playerid, DriftTD);
	TextDrawShowForPlayer(playerid, StuntTD);
	TextDrawShowForPlayer(playerid, DragTD);
	TextDrawShowForPlayer(playerid, DownBar);
	TextDrawShowForPlayer(playerid, Viata);


	PreloadAnimLib(playerid,"BOMBER");
	PreloadAnimLib(playerid,"RAPPING");
   	PreloadAnimLib(playerid,"SHOP");
	PreloadAnimLib(playerid,"BEACH");
	PreloadAnimLib(playerid,"SMOKING");
   	PreloadAnimLib(playerid,"FOOD");
   	PreloadAnimLib(playerid,"ON_LOOKERS");
   	PreloadAnimLib(playerid,"DEALER");
	PreloadAnimLib(playerid,"CRACK");
	PreloadAnimLib(playerid,"CARRY");
	PreloadAnimLib(playerid,"COP_AMBIENT");
	PreloadAnimLib(playerid,"PARK");
	PreloadAnimLib(playerid,"INT_HOUSE");
	PreloadAnimLib(playerid,"FOOD");
	PreloadAnimLib(playerid,"PED");
	PlayerInfo[playerid][SpawnDance] = true;
 	ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);

 	new pName[24];
    new string[128];
    GetPlayerName(playerid, pName, 24);
    SendClientMessageToAllLang(COLOR_GREY, "*** %s a intrat pe Server (ID:%d)", Player(playerid), playerid);
    TextDrawLetterSize(JLtext, 0.4 ,1.0);
    TextDrawSetShadow(JLtext, 1);
	TextDrawSetString(JLtext, string);
	TextDrawShowForAll(JLtext);
	SetTimer("TDTime",5000,false);

	return 1;
}

public OnPlayerDisconnect(playerid)
{
	DisconnectPlayer(playerid);
	TextDrawDestroy(HealthBar[playerid]);
	KillTimer( PlayerInfo[playerid][SpawnTimer] );
	new pName[24];
    new string[128];
    new reason;
    GetPlayerName(playerid, pName, 24);
    switch(reason)
    {
	if(reason == 0){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (EROARE)", Player(playerid)); printf("[part] %s a iesit (EROARE)",Player(playerid)); }
	if(reason == 1){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (Ne-a parasit)",Player(playerid)); printf("[part] %s a iesit (Ne-a parasit)",Player(playerid)); }
	if(reason == 2){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (Kick/Ban)",Player(playerid)); printf("[part] %s a iesit (Kick/Ban)",Player(playerid)); }
    }
    TextDrawSetString(JLtext, string);
    TextDrawShowForAll(JLtext);
    SetTimer("TDTime",5000,false);
	return 1;
}

Ce trebuie schimbat ?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Guest RockStar

Ar trebui sa mearga , adaugi sub OnPlayerConnect

new str[128] , PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
format(str,sizeof(str),"{00CEFC}*** %s {FFFFFF}({FC0303}%d{FFFFFF}) {00FF19}a intrat pe server", PlayerName, playerid);
SendClientMessageToAll(COLOR_WHITE,str);
Este deja colorat frumos pentru 0.3c ;) Edit :
public OnPlayerConnect(playerid)
{
        new str[128] , PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        format(str,sizeof(str),"{00CEFC}*** %s {FFFFFF}({FC0303}%d{FFFFFF}) {00FF19}a intrat pe server", PlayerName, playerid);
        SendClientMessageToAll(COLOR_WHITE,str);

	HaveTicket[playerid] = 0;
	ConnectPlayer(playerid);
	GameTextForPlayer(playerid," [s]Nume server[/s] ",5000,5);
	SetPlayerScore(playerid, GetPlayerScore(playerid) + 100);
	SetPlayerArmour(playerid,1000);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		TextDrawShowForPlayer(i, Text:Clock[i]);
	}
	HealthBar[playerid] = TextDrawCreate(549.000000,52.000000,"..........");
	TextDrawAlignment(HealthBar[playerid],1);
	TextDrawBackgroundColor(HealthBar[playerid],0x00ff00ff);
	TextDrawFont(HealthBar[playerid],3);
	TextDrawLetterSize(HealthBar[playerid],0.569999,2.549999);
	TextDrawColor(HealthBar[playerid],0x00ff0033);
	TextDrawSetOutline(HealthBar[playerid],1);
	TextDrawSetProportional(HealthBar[playerid],1);
	TextDrawSetShadow(HealthBar[playerid],1);

	TextDrawShowForPlayer(playerid, DriftTD);
	TextDrawShowForPlayer(playerid, StuntTD);
	TextDrawShowForPlayer(playerid, DragTD);
	TextDrawShowForPlayer(playerid, DownBar);
	TextDrawShowForPlayer(playerid, Viata);


	PreloadAnimLib(playerid,"BOMBER");
	PreloadAnimLib(playerid,"RAPPING");
   	PreloadAnimLib(playerid,"SHOP");
	PreloadAnimLib(playerid,"BEACH");
	PreloadAnimLib(playerid,"SMOKING");
   	PreloadAnimLib(playerid,"FOOD");
   	PreloadAnimLib(playerid,"ON_LOOKERS");
   	PreloadAnimLib(playerid,"DEALER");
	PreloadAnimLib(playerid,"CRACK");
	PreloadAnimLib(playerid,"CARRY");
	PreloadAnimLib(playerid,"COP_AMBIENT");
	PreloadAnimLib(playerid,"PARK");
	PreloadAnimLib(playerid,"INT_HOUSE");
	PreloadAnimLib(playerid,"FOOD");
	PreloadAnimLib(playerid,"PED");
	PlayerInfo[playerid][SpawnDance] = true;
 	ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);

 	new pName[24];
    new string[128];
    GetPlayerName(playerid, pName, 24);
    SendClientMessageToAllLang(COLOR_GREY, "*** %s a intrat pe Server (ID:%d)", Player(playerid), playerid);
    TextDrawLetterSize(JLtext, 0.4 ,1.0);
    TextDrawSetShadow(JLtext, 1);
	TextDrawSetString(JLtext, string);
	TextDrawShowForAll(JLtext);
	SetTimer("TDTime",5000,false);

	return 1;
}

public OnPlayerDisconnect(playerid)
{
	DisconnectPlayer(playerid);
	TextDrawDestroy(HealthBar[playerid]);
	KillTimer( PlayerInfo[playerid][SpawnTimer] );
	new pName[24];
    new string[128];
    new reason;
    GetPlayerName(playerid, pName, 24);
    switch(reason)
    {
	if(reason == 0){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (EROARE)", Player(playerid)); printf("[part] %s a iesit (EROARE)",Player(playerid)); }
	if(reason == 1){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (Ne-a parasit)",Player(playerid)); printf("[part] %s a iesit (Ne-a parasit)",Player(playerid)); }
	if(reason == 2){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (Kick/Ban)",Player(playerid)); printf("[part] %s a iesit (Kick/Ban)",Player(playerid)); }
    }
    TextDrawSetString(JLtext, string);
    TextDrawShowForAll(JLtext);
    SetTimer("TDTime",5000,false);
	return 1;
}

Asa ar trebui sa mearga

Link to comment
Share on other sites

(250) : error 017: undefined symbol "SendClientMessageToAllLang"

linia 250:

SendClientMessageToAllLang(COLOR_GREY, "*** %s a intrat pe Server (ID:%d)", Player(playerid), playerid);
(271) : error 002: only a single statement (or expression) can follow each "case" (271) : error 029: invalid expression, assumed zero (271) : error 017: undefined symbol (271) : fatal error 107: too many error messages on one line linia 271:
if(reason == 0){ SendClientMessageToAllLang(COLOR_GREY, "*** %s a iesit (EROARE)", Player(playerid)); printf("[part] %s a iesit (EROARE)",Player(playerid)); }

EDIT:

Multumesc de ajutor :D mesajul cu %s a intrat pe server merge :D dar cel cu a iesit nu :(

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.