Jump to content
  • 0

Don't send la compilare /healall


calin1996

Question

[pawn] if(strcmp(cmd, "/healall", true) == 0)

{

if(PlayerInfo[playerid][pAdmin] >= 3)

{

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, 256, "ADMININUL %s a setat tuturor playerilor 100 puncte de viata.", sendername);

ABroadCast(COLOR_YELLOW,string,1);

      for(new i = 0; i < MAX_PLAYERS; i ++)

        {

          SetPlayerHealth(i,100);

}

}

return 1;

}

[/pawn]

Toate bracketurile sunt la locul lor cred.....

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Incearca asa:

 
    if(strcmp(cmd, "/healall", true) == 0)
	{
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(IsPlayerConnected(playerid))
		{
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
				format(string, sizeof(string), "ADMINUL %s a setat tuturor playerilor 100 puncte la viata.", sendername);
				SCMTA(COLOR_LIGHTRED, string);
				for(new i = 0; i < MAX_PLAYERS; i ++)
				{
					if(IsPlayerConnected(i))
					{
						SetPlayerHealth(i, 100);
					}
				}
			}
		}
		return 1;
	}

Link to comment
Share on other sites

sau asa [pawn] if(strcmp(cmd, "/healall", true) == 0)

{

    GetPlayerName(playerid, sendername, sizeof(sendername));

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pAdmin] >= 3)

        {

        format(string, sizeof(string), "Adminul %s a dat viata la toata lumea.", sendername);

    SendClientMessageToAll(0xFF7171FF, string);

            for(new i = 0; i < MAX_PLAYERS; i ++)

{

    if(IsPlayerConnected(i))

    {

    SetPlayerHealth(i, 100);

}

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "Nu ai permisiunea de a folosi aceasta comanda!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "Trebuie sa fi logat pentru a folosi aceasta comanda!");

}

return 1;

}

[/pawn]

I'm back haha !

Link to comment
Share on other sites

Mersi,merge dar mai am o problema,[pawn] warning 225: unreachable code[/pawn] pt ca am am adaugat asta:

[pawn]if(strcmp(cmd, "/contract", true) == 0)

{

    if(IsPlayerConnected(playerid))

  {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");

return 1;

}

giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /contract [playerid/PartOfName] [amount]");

return 1;

}

moneys = strval(tmp);

if(moneys < 1000 || moneys > 1000000) { SendClientMessage(playerid, COLOR_GREY, "  Contract money must be atleast $1000, and not more then $1000000!"); return 1; }

if(PlayerInfo[playerid][pLevel] < 2)

{

SendClientMessage(playerid, COLOR_GRAD1, "You must be level 2 to place a Contract.");

return 1;

}

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

    if(PlayerInfo[giveplayerid][pMember] == 8 && PlayerInfo[playerid][pMember] == 8)

    {

        SendClientMessage(playerid, COLOR_GREY, "* Cannot place Contracts on your own Agency!");

        return 1;

    }

    else if(PlayerInfo[giveplayerid][pLeader] == 8 && PlayerInfo[playerid][pMember] == 8)

    {

        SendClientMessage(playerid, COLOR_GREY, "* Cannot place Contracts on your own Agency!");

        return 1;

    }

    else if(PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLeader] == 8)

    {

        SendClientMessage(playerid, COLOR_GREY, "* Can't contract a Hitman !");

        return 1;

    }

    if(PlayerInfo[playerid][pAdmin] == 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "* You may not place a contract on admin/testers on duty");

        return 1;

    }

    if(IsACop(giveplayerid) && moneys < 30000)

    {

        SendClientMessage(playerid, COLOR_GREY, "* Only $30000 or above can be placed as a Contract on Cops !");

        return 1;

    }

    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "* You cannot Contract yourself!"); return 1; }

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

playermoney = GetPlayerMoney(playerid);

if (moneys > 0 && playermoney >= moneys)

{

SafeGivePlayerMoney(playerid, (0 - moneys));

PlayerInfo[giveplayerid][pHeadValue]+=moneys;

format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);

SendFamilyMessage(8, COLOR_YELLOW, string);

format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);

SendClientMessage(playerid, COLOR_WHITE, string);

format(string, sizeof(string), "[iNFO]: %s (%d) has placed a contract on %s (%d) for $%d", sendername, playerid, giveplayer,giveplayerid, moneys);

SendAdminMessage(COLOR_YELLOW,string);

SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Someone has placed a hit contract on you, you might want protection!");

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Invalid transaction amount.");

}

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}

SendClientMessage(playerid,COLOR_GREY, "SERVER: You have Typed An Unknown Command, Type /help or /atalk if you need Help!");

return 1;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.