Jump to content

Question

Posted

Salut, am incercat sa fac o comanda care sa dea jucatorilor din apropierea celui care a scris comanda, heal. Dar nu stiu cum sa fac sa dea heal doar celor de langa el , eu am incercat asa

[pawn]if(strcmp(cmdtext, "/healx", true) == 0)

{

    new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

if(IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z))

{

    SendClientMessageToAll(-1, "Cei in apropiere ati primit heal");

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

{

    if(IsPlayerConnected(i))

    {

    SetPlayerHealth(i, 100);

}

}

}

return 1;

}[/pawn]

<3 FCP 3>

9 answers to this question

Recommended Posts

Posted

Poftim 

if(strcmp(cmd, "/sethp", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}Info{FFFFFF}: /sethp [playerid/PartOfName] [health]");

return 1;

}

new playa;

new health;

GetPlayerName(playa, sendername, sizeof(sendername));

playa = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

health = strval(tmp);

if (PlayerInfo[playerid][pAdminServer] >= 1 && health <= 100)

{

    if(IsPlayerConnected(playa))

    {

        if(playa != INVALID_PLAYER_ID)

        {

SetPlayerHealth(playa, health);

GetPlayerName(playa, giveplayer, sizeof(giveplayer));

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

format(string, 256, "%s ia setat lui %s hp %d.", sendername,giveplayer,health);

ABroadCast(COLOR_ADMIN,string,1);

//GetPlayerName(para1, giveplayer, sizeof(giveplayer));

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

}

}

}

else

{

SendClientMessage(playerid, COLOR_RED, "Nu esti autorizat, sau valoare invalida!");

}

}

return 1;

}

Scripting for $$ .

CONTACT: [email protected] .

Posted

Nu este ce caut eu , eu vreau sa dau heal unor jucator care sunt in apropierea mea. Ce ai pus tu acolo este sa setezi hp-ul unui player, ms oricum.

<3 FCP 3>

Posted
	if(strcmp(cmd, "/aevent", true) == 0)
    {
      	if(IsPlayerConnected(playerid))
      	{
        	if(PlayerInfo[playerid][pAdmin] >= 1)
        	{
              	new x_nr[256];
              	x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr))
            	{
                	SendClientMessage(playerid, COLOR_WHITE, "FOLOSINTA: /aevent [nume] (60.0 meters default)");
                	SendClientMessage(playerid, COLOR_GRAD5, "Nume Disponibile: heal, armour, gethere, givegun, disarm, respawn");
                	SendClientMessage(playerid, COLOR_GRAD5, "mute, unmute, freeze, unfreeze ,repair.");
                	return 1;
                }
            	if(strcmp(x_nr,"heal",true) == 0)
             	{
					new amount;
            		tmp = strtok(cmdtext, idx);
            		amount = strval(tmp);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid,COLOR_GREY,"FOLOSINTA: /aevent heal [suma]");
						return 1;
					}
 					GetPlayerName(playerid, sendername, sizeof(sendername));
                    for(new i = 0; i <= MAX_PLAYERS; i++)
					{
						if (ProxDetectorS(60.0, playerid, i))
						{
							format(string, sizeof(string), "[EVENT]: Administratorul %s v-a setat viata tuturor la %d.0 HP.",sendername,amount);
 							SendClientMessage(i, COLOR_LIGHTRED, string);
						 	SetPlayerHealth(i, amount);
						}
					}
					return 1;
                }

  incearca cu asta...

Posted

Am incercat asta dar daca o pun in GM primesc erorile [pawn]C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3528) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3532) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3544) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3548) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3552) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3556) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3560) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3564) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3568) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3580) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3584) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3588) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3592) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3596) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3608) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3612) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3616) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3628) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3632) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3636) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3640) : error 004: function "PlayerToPoint" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3854) : error 017: undefined symbol "log_new_join"

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(3855) : error 017: undefined symbol "number_joins_time_range"

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(4059) : error 004: function "ClearChatbox" is not implemented

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(4167) : error 017: undefined symbol "AddLastLogin"

C:\Users\user\Desktop\RPG\gamemodes\mania.pwn(4586) : error 017: undefined symbol "PlayerName"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

26 Errors.[/pawn]. Daca o sterg se compileaza.

<3 FCP 3>

Posted

Nu ai pus pus acolada pe undeva , cauta pe unde ai umblat si puneao si dupa dai Complie.

<a href="http://www.game-state.eu/94.60.40.50:7777/"><img src="http://www.game-state.eu/94.60.40.50:7777/n-560x95_FFFFFF_FFFFFF_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Posted
       if(strcmp(cmdtext, "/healx", true) == 0)
	{
	        new Float:x, Float:y, Float:z;
                GetPlayerPos(playerid, x, y, z);
                for(new i = 0; i<MAX_PLAYERS; i++);
                {
                     if(IsPlayerConnected(i))
                     {
		          
		         if(IsPlayerInRangeOfPoint(i, 7.0, x, y, z))
		         {
		                SendClientMessageToAll(-1, "Cei in apropiere ati primit heal");
			        SetPlayerHealth(i, 100);
			}
		}
		return 1;
	}

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

Mersi Gireada, deci aproape cum facusem eu trebuia, dar mai am o intrebare. Cum schimb raza? de ex sa dea pe o raza de 200m, nu stiu unde am vazut si nu stiu daca e adevarat dar scria ca default este 60m.

<3 FCP 3>

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.