SA-MP Forums Archive
Command /areaREPAIR ? - 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: Command /areaREPAIR ? (/showthread.php?tid=605974)



Command /areaREPAIR ? - EuBagPula - 27.04.2016

Hi, i have a problem with command /arearepair.

Код:
CMD:arearepair(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2 )
	{
		new Float:raza;
		if(sscanf(params, "f", raza)) MSG(playerid, -1, "{99FF00}Usage: {FFFFFF}/arearepair <range>");
		else
		{
			new Float:x, Float:y, Float:z;
			GetPlayerPos(playerid, Float:x, Float:y, Float:z);
			for(new i=0; i<MAX_VEHICLES; i++)
			{
			    RepairVehicle(i);
				SetVehicleHealth(i, 100);
				for(new p=0; p<MAX_PLAYERS; p++)
				{
				     if(IsPlayerInRangeOfPoint(p, raza, Float:x, Float:y, Float:z))
			    	     {
					    new string[264], AN[MAX_PLAYER_NAME];
					    GetPlayerName(playerid, AN, sizeof(AN));
					    format(string, sizeof(string), "{FF0000}Info: {FFFFFF}%s a reparat toate vehiculele din raza de %f metrii.", AN, raza);
					    SendClientMessage(p, -1, string);
				     }
				}
			}
		}
	}
	else
	{
	    MSG(playerid, -1, "{CC0000}(!) Nu esti autorizat sг folosesti aceastг comandг.");
	}
	return 1;
}
When i use /arearepair 50 for example, nothing happens. Why ?

I'm new in pawn, so do not "jump" on me


Re: Command /areaREPAIR ? - BloodyRP - 27.04.2016

Please, dont do that:
Код:
for(new i=0; i<MAX_VEHICLES; i++)
			{
			    for(new p=0; p<MAX_PLAYERS; p++)
				{



Re: Command /areaREPAIR ? - EuBagPula - 27.04.2016

Quote:
Originally Posted by BloodyRP
Посмотреть сообщение
Please, dont do that:
Код:
for(new i=0; i<MAX_VEHICLES; i++)
			{
			    for(new p=0; p<MAX_PLAYERS; p++)
				{
But ?


Re: Command /areaREPAIR ? - BloodyRP - 27.04.2016

PHP код:
CMD:arearepair(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < ) return MSG(playerid, -1"{CC0000}(!) Nu esti autorizat s? folosesti aceast? comand?.");
    if(
sscanf(params"d"params[0])) return MSG(playerid, -1"{99FF00}Usage: {FFFFFF}/arearepair <range>");
    new 
Float:x1Float:y1Float:z1;
    
GetPlayerPos(playerid,x1,y1,z1);
    for(new 
i=0i<MAX_VEHICLESi++)
    {
        new 
FloatfDistance GetVehicleDistanceFromPoint(ix1y1z1);
        if(
fDistance <= params[0]) RepairVehicle(i);
    }
    return 
true;




Re: Command /areaREPAIR ? - EuBagPula - 27.04.2016

Quote:
Originally Posted by BloodyRP
Посмотреть сообщение
PHP код:
CMD:arearepair(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < ) return MSG(playerid, -1"{CC0000}(!) Nu esti autorizat s? folosesti aceast? comand?.");
    if(
sscanf(params"d"params[0])) return MSG(playerid, -1"{99FF00}Usage: {FFFFFF}/arearepair <range>");
    new 
Float:x1Float:y1Float:z1;
    
GetPlayerPos(playerid,x1,y1,z1);
    for(new 
i=0i<MAX_VEHICLESi++)
    {
        new 
FloatfDistance GetVehicleDistanceFromPoint(ix1y1z1);
        if(
fDistance <= params[0]) RepairVehicle(i);
    }
    return 
true;

Thx, but I want and the message.. "The admin X repaired all vehicles from range Y.."


Re: Command /areaREPAIR ? - DarK_FeneR - 30.04.2016

I think there is not any error...