SA-MP Forums Archive
Help Godcar command - 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: Help Godcar command (/showthread.php?tid=292069)



Help Godcar command - ssKiller - 22.10.2011

Hey can you tell me why my car isn't repairing just fixing(Car health doesn't go down but the Body gets damaged).

Код:
dcmd_godcar(playerid,params[])
{

	#pragma unused params
	if(AccInfo[playerid][Level] >= 0 || IsPlayerAdmin(playerid))
	{	GetPlayerVehicleID(playerid);
RepairVehicle(GetPlayerVehicleID(playerid));
    	SetVehicleHealth(playerid,1000);
		if(IsPlayerInAnyVehicle(playerid))

		{
	    	if(AccInfo[playerid][GodCar] == 0)
			{
        		AccInfo[playerid][GodCar] = 1;
   				SendCommandToAdmins(playerid,"GodCar");
            	return SendClientMessage(playerid,white,"You have {32CD32}enabled{FFFFFF} godcar mode!");
				}
				else
				{
	            AccInfo[playerid][GodCar] = 0;
    	        return SendClientMessage(playerid,white,"You have {FF002B}disabled{FFFFFF} godcar mode!");
				}
		}
		else return SendClientMessage(playerid,red,"ERROR: You need to be in a car to use this command");
	}
	else return ErrorMessages(playerid, 5);
}
Thanks for reading


Re: Help Godcar command - =WoR=G4M3Ov3r - 22.10.2011

PHP код:
dcmd_godcar(playerid,params[])

    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You are not an Admin"); 
    { 
        new 
vehicleid GetPlayerVehicleID(playerid); 
        
SetVehicleHealth(vehicleid9999999999.0); 
    } 
    return 
1

Made that code a while ago, try it instead of yours.


Re: Help Godcar command - ssKiller - 22.10.2011

That's not what i mean,I mean like that script below but just that it repairs body too


Re: Help Godcar command - =WoR=G4M3Ov3r - 22.10.2011

Quote:
Originally Posted by ssKiller
Посмотреть сообщение
That's not what i mean,I mean like that script below but just that it repairs body too
PHP код:
dcmd_godcar(playerid,params[])

    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You are not an Admin"); 
    { 
        new 
vehicleid GetPlayerVehicleID(playerid);
        
SetVehicleHealth(vehicleid9999999999.0);
        
RepairVehicle(vehicleid);
        return 
1;
    }