Command /areaREPAIR ?
#1

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
Reply
#2

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

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 ?
Reply
#4

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;

Reply
#5

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.."
Reply
#6

I think there is not any error...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)