SA-MP Forums Archive
Messages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Messages (/showthread.php?tid=353608)



Messages - Pawwno - 23.06.2012

Hello. I have a problem, and i really don't know how to fix it. I hope you can help me guys. At almost every command i have, it doesn't show me all SendClientMessage's or Format's. All the command are good, and i really don't know why. Sorry for my english.


Re: Messages - Ironboy - 23.06.2012

Show the code.


Re: Messages - Pawwno - 23.06.2012

Код:
CMD:ajail (playerid, params [])
{
	new IID;
	new Motiv [256];
	new Timp;
	if (PlayerInfo [playerid] [pAdmin] < 1)
	{
	    return SendClientMessage (playerid, 0xFFDEAD, "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Nu ai acces la aceasta comanda. Doar adminii pot folosi aceasta comanda. {FFA500}***");
	}
	else if (sscanf (params, "uds [128]", IID, Timp, Motiv))
	{
	    return SendClientMessage (playerid, 0xFFDEAD, "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Formatul corect al acestei comenzi este : {CDB5CD}'/ajail [ID Jucator] [Timp] [Motiv]'{FFDEAD}. {FFA500}***");
	}
	else if (isnull (params))
	{
	    SendClientMessage (playerid, 0xFFDEAD, "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Formatul corect al acestei comenzi este : {CDB5CD}'/ajail [ID Jucator] [Timp] [Motiv]'{FFDEAD}. {FFA500}***");
		return 1;
	}
	else if (IID == INVALID_PLAYER_ID)
	{
	    return SendClientMessage (playerid, 0xFFDEAD, "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Nu este niciun jucator conectat ce detine acest ID. {FFA500}***");
	}
	else if (PlayerInfo [playerid] [pInchis] == 1)
	{
	    return SendClientMessage (playerid, 0xFFDEAD, "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Acest jucator este deja inchis. {FFA500}***");
	}
	else if (Timp < 1 || Timp > 1000)
	{
	    return SendClientMessage (playerid, 0xFFDEAD, "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Timpul trebuie sa fie intre 1 si 1000 minute. {FFA500}***");
	}
	else
	{
	    new Jucator [MAX_PLAYER_NAME];
	    new Jucator2 [MAX_PLAYER_NAME];
	    new Mesaj1 [256];
	    new Mesaj2 [256];
	    new Mesaj3 [256];
	    GetPlayerName (IID, Jucator, sizeof (Jucator));
	    GetPlayerName (playerid, Jucator2, sizeof (Jucator2));
	    format (Mesaj1, sizeof (Mesaj1), "{FFA500}*** {B22222}[Anunt global] {FFDEAD}%s a fost inchis de catre admin-ul %s timp de %d minute. Motiv : %s. {FFA500}***", Jucator, Jucator2, Timp, Motiv);
		SendClientMessageToAll (0xFFDEAD, Mesaj1);
		format (Mesaj2, sizeof (Mesaj2), "{FFA500}*** {9370DB}[Informatie] {FFDEAD}L-ai inchis pe %s timp de %d minute. Motiv : %s. {FFA500}***", Jucator, Timp, Motiv);
		SendClientMessage (playerid, 0xFFDEAD, Mesaj2);
		format (Mesaj3, sizeof (Mesaj3), "{FFA500}*** {9370DB}[Informatie] {FFDEAD}Ai fost inchis de catre admin-ul %s timp de %d minute. Motiv : %s. {FFA500}***", Jucator2, Timp, Motiv);
		SendClientMessage (IID, 0xFFDEAD, Mesaj3);
		PlayerInfo [playerid] [pInchis] = 1;
		SetPlayerPos (IID, 264.53, 77.43, 1001.04);
		SetPlayerInterior (IID, 6);
		SetPlayerVirtualWorld (IID, 1337);
		Timer_Inchis [IID] = SetTimerEx ("Timp_Inchis", 60000 * Timp, 0, "i", IID);
	}
	return 1;
}
This is just one example, only 2 messages showed up.


Re: Messages - SuperViper - 23.06.2012

If the message is too long, it won't be sent.


Re: Messages - Pawwno - 23.06.2012

I defined [256]... How many characters are max?


Re: Messages - FUNExtreme - 23.06.2012

128 max.. Anyway., what messages show and which ones don't show but should show when you do the command?


Re: Messages - Pawwno - 23.06.2012

The last 2 formats are showed. The sscanf's SendClientMessage isn't showed. And one SendClientMessage is showed, "Acest jucator este deja...".


Re: Messages - Pawwno - 24.06.2012

Nobody know how to fix it?


Re: Messages - Grand_Micha - 24.06.2012

Be aware of the fact that you use "else if" statements and that you return things in each.
What the heck are you trying to do? Maybe we could find a more...elegant solution.


Re: Messages - Pawwno - 24.06.2012

Another solution? I need else if. The return's are the problem?

# I tried without the return's, same problem. Please, give me one solution.