SA-MP Forums Archive
Client Message Little Problem. - 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: Client Message Little Problem. (/showthread.php?tid=390995)



Client Message Little Problem. - Laure - 09.11.2012

Hey all i tried to make the paycheck command to send to Client Messages if will passed 45 mins it will say You will recieve a paycheck at the end of the hour and if not then say You wont recieve a paycheck at the end of the hour.
But i get one of the client message two times like if i passed 45 min it says me you will receive a paycheck at the end of the hour.And if not You wont receive client message two times i got the code here.
Код:
CMD:paycheck(playerid, params[])
{
	new string[128], i;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	format(string, sizeof(string), "* You have played exactly %d/45 minutes since your last paycheck.", PlayerInfo[playerid][pMinutes]);
	SendClientMessage(i, COLOR_LIGHTBLUE, string);
	if(PlayerInfo[playerid][pMinutes] < 45) {format(string, sizeof(string), "* You wont recieve a paycheck at the end of the hour.");}
	SendClientMessage(playerid, COLOR_LIGHTRED, string);
	format(string, sizeof(string), "* You will recieve a paycheck at the end of the hour.");
	SendClientMessage(playerid, COLOR_YELLOW2, string);
	return 1;
}



Re: Client Message Little Problem. - Glad2BeHere - 09.11.2012

pawn Код:
CMD:paycheck(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    format(string, sizeof(string), "* You have played exactly %d/45 minutes since your last paycheck.", PlayerInfo[playerid][pMinutes]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    if(PlayerInfo[playerid][pMinutes] < 45)
    {
    format(string, sizeof(string), "* You wont recieve a paycheck at the end of the hour.");

    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    }
    else
    format(string, sizeof(string), "* You will recieve a paycheck at the end of the hour.");
    SendClientMessage(playerid, COLOR_YELLOW2, string);
    return 1;
}
(Y) hope it works


Re: Client Message Little Problem. - PaulDinam - 09.11.2012

Код:
CMD:paycheck(playerid, params[])
{
	new string[128], i;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	format(string, sizeof(string), "* You have played exactly %d/45 minutes since your last paycheck.", PlayerInfo[playerid][pMinutes]);
	SendClientMessage(i, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "* You wont recieve a paycheck at the end of the hour.");
	if(PlayerInfo[playerid][pMinutes] < 45) return SendClientMessage(playerid, COLOR_LIGHTRED, string);
	format(string, sizeof(string), "* You will recieve a paycheck at the end of the hour.");
	SendClientMessage(playerid, COLOR_YELLOW2, string);
	return 1;
}
try this


Re: Client Message Little Problem. - Glad2BeHere - 09.11.2012

One more thing um why do u have "i" in the new there is no all u have "i" which does nothing,

if u want to do foreach player get foreach include and do
pawn Код:
foreach(Player, i)



Re: Client Message Little Problem. - Laure - 09.11.2012

Pauls one helped me anyway thanks for trying others.