+1 for help,repeat sendclientmessage
#1

Hello!
I'm have a big problem:
When im type /oplace is repeat message a million times
WTF?
Why?
Message:
Код:
{98AFC7}Evenimentul GIFTBOX a fost pornit de catre admin %s! [/GIFTBOX]
Full code:
Код:
dcmd_oplace(playerid, params[])
{
	#pragma unused params
	if(AccountInfo[playerid][aLevel] <= 9) return SCM(playerid, ERROR, "Trebuie sa fii admin 10 pentru a putea pune un giftbox");
	else if(IsPlayerConnected(playerid) == 0) return SCM(playerid, ERROR, "Trebuie sa fii conectat pentru a putea porni giftbox");
 	else
	{
	    new Float:x, Float:y, Float:z, Float:a, name[60], stringgb[200];
	    GetPlayerFacingAngle(playerid, a);
	    GetPlayerName(playerid, name, 60);
	    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
        CreateObject(19056, x, y, z, 0, 0, 0);
        GiftStarted = true;
        Create3DTextLabel("{FFA500}GIFTBOX!\n{00FF00}Scrie /getgift pentru a\n{00FF00}primi un {FF00FF}CADOU!", 0x008080FF, x, y, z, 0, 0, 0);
		format(stringgb, 200, "{98AFC7}Evenimentul GIFTBOX a fost pornit de catre admin %s! [/GIFTBOX]", name);
		SendClientMessageToAll(COLOR_LIGHTCYAN, stringgb);
		for(new i=0; i< MAX_PLAYERS; i++)
		AccountInfo[i][GiftHours] = 3;
        }
	return 1;
}
SCM = SendClientMessage

+1 FOR HELP!

(sorry for my bad english)
Reply
#2

Код:
dcmd_oplace(playerid, params[])
{
	if(AccountInfo[playerid][aLevel] <= 9) return SCM(playerid, ERROR, "Trebuie sa fii admin 10 pentru a putea pune un giftbox");

	 if(IsPlayerConnected(playerid) == 0) return SCM(playerid, ERROR, "Trebuie sa fii conectat pentru a putea porni giftbox");

	    new Float:x, Float:y, Float:z, Float:a, name[26], stringgb[126];
	    GetPlayerFacingAngle(playerid, Float:a);
	    GetPlayerName(playerid, name, 30);
	    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
            CreateObject(19056, x, y, z, 0, 0, 0);
            GiftStarted = true;
            Create3DTextLabel("{FFA500}GIFTBOX!\n{00FF00}Scrie /getgift pentru a\n{00FF00}primi un 
            {FF00FF}CADOU!", 0x008080FF, x, y, z, 0, 0, 0);
	     format(stringgb, 200, "{98AFC7}Evenimentul GIFTBOX a fost pornit de catre admin %s! [/GIFTBOX]", 
             name);
		SendClientMessageToAll(COLOR_LIGHTCYAN, stringgb);

		for(new i=0; i< MAX_PLAYERS; i++)
               {
		    AccountInfo[i][GiftHours] = 3;
               }
	return 1;
}
I guess the braces with for loop should help. Anyway, I cleaned the code a little.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)