SA-MP Forums Archive
Help:How Do I Make This Code Be For admin's Only - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help:How Do I Make This Code Be For admin's Only (/showthread.php?tid=260827)



Help:How Do I Make This Code Be For admin's Only - Bmxerlmao5288 - 10.06.2011

Код:
if (!strcmp("/quickrepaircar",cmdtext,true))
		{
		if(IsPlayerInAnyVehicle(playerid))
		{
		SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
		SendClientMessage(playerid,COLOR_GREEN, "Car is repaired.");
		}
		return 1;}
I Want it to work for admins only


Re: Help:How Do I Make This Code Be For admin's Only - Haydn - 10.06.2011

IsPlayerAdmin?


Re: Help:How Do I Make This Code Be For admin's Only - Bmxerlmao5288 - 10.06.2011

So instead its

Код:
if (!strcmp("/quickrepaircar",cmdtext,true))
		{
		if(IsPlayeradmin(playerid))
		{
		SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
		SendClientMessage(playerid,COLOR_GREEN, "Car is repaired.");
		}
?


Re: Help:How Do I Make This Code Be For admin's Only - Haydn - 10.06.2011

This may help you.


AW: Help:How Do I Make This Code Be For admin's Only - Julian12345 - 10.06.2011

pawn Код:
if (!strcmp("/quickrepaircar",cmdtext,true))
    {
    if(IsPlayerAdmin(playerid))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
            SendClientMessage(playerid,COLOR_GREEN, "Car is repaired.");
        }
        return 1;}
    }



Re: Help:How Do I Make This Code Be For admin's Only - grand.Theft.Otto - 11.06.2011

Just remember IsPlayerAdmin is for RCon admins only.