Jump to content
  • 0

Intrebare Join / leave


Question

Posted

Salut , am folosit un program SA-MP PWN din colectia lui FarSe si am facut urmatoarele functii

new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0xFFFFFFFF, string);
Unde as putea aseza asta ca sa apara in chat cand se conecteaza un player iar ,
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has leave the server", pname);
SendClientMessageToAll(0xFFFFFFFF, string); 

asta cand iese un player ? :-?

Multumesc :)

8 answers to this question

Recommended Posts

Posted

gameson.pwn(10813) : error 021: symbol already defined: "string"

asta este linia : new string[256], pname[MAX_PLAYER_NAME];

Posted

Mai am inca o problema , l-am testat am bagat si la OnPlayerDisconect asta

	new pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string, sizeof(string), "%s has leaved the server", pname);
	SCMTA(0xFFFFFFFF, string);

Si cand iese un player dupa server nu apare ...

Iar pentru cealalta la OnPlayerConnect nu apare tot cuvantul server , apare doar se :-??

Posted

deci fa asa:

new str[ 256 ];
format( str, sizeof( str ), "%s has joined the server", PlayerName( playerid ) );
SendClientMessage( playerid, COLOR_RED, str );
stock-ul PlayerName:
stock PlayerName( playerid )
{
    new name[ 24 ];
    GetPlayerName( playerid, name, 24 );
    return name;
}
la OnPlayerDisconnect
if ( IsPlayerConnected( playerid )
{
    new str[ 256 ];
    format( str, sizeof( str ), "%s has left the server!", PlayerName( playerid ) );
    SendClientMessageToAll( COLOR_RED, str );
}

Fara reclama in semnatura!

Posted

la OnPlayerDisconnect

if ( IsPlayerConnected( playerid )
 {
    new str[ 256 ];
    format( str, sizeof( str ), "%s has left the server!", PlayerName( playerid ) );
    SendClientMessageToAll( COLOR_RED, str );
}

(11252) : error 001: expected token: ")", but found "{"

linia este a2a adica " { "

EDIT: Daca o sterg imi da alte erori ( mai multe ) !

EDIT [ 2 ] : Am rezolvat problema aia , am adaugat inca o paranteza adica asa " if ( IsPlayerConnected( playerid )) "

Dar imi mai da un warning : (61866) : warning 219: local variable "PlayerName" shadows a variable at a preceding level

Linia este : new stringa[80], PlayerName[MAX_PLAYER_NAME];

Afecteaza cu ceva sau il las asa  :D?

Posted

era pus .....

	if(ReactionState == R_STATE_ACTIVE)
	{
		if(!strcmp(text, ReactionString, false))
		{
		    ReactionState = R_STATE_NOT_ACTIVE;
			new stringa[80], PlayerName[MAX_PLAYER_NAME];
			GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
			format(stringa,sizeof(stringa),"** %s has won the fast event and recieved $%d! **",PlayerName,ReactionCash);
			SCMTA(TEAM_Grove_COLOR,stringa);
			GivePlayerMoney(playerid,ReactionCash);
			ReactionCash = 0;
		}
	}

Era de la astea !

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.