SA-MP Forums Archive
How do I make this code... - 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: How do I make this code... (/showthread.php?tid=253479)



How do I make this code... - Join7 - 06.05.2011

How do I make this code to check whether your car before you says "You have successfully removed the vehicle."?

Код:
	if(strcmp(cmd, "/destroycar", true)== 0)
	{
	    if(PlayerInfo[playerid][pAdmin] > 1)
	    {
	        new removeVeh = GetPlayerVehicleID(playerid);
            SendClientMessage(playerid, COLOR_GRAD1, "You have successfully removed the vehicle.");
            DestroyVehicle(removeVeh);
	        return 1;
		}
		else
		{
            SendClientMessage(playerid, COLOR_GRAD1, "You are not an admin!");
		}
	}



Re: How do I make this code... - X3nZ - 06.05.2011

The way it looks...

It should be working fine..

Does it not say that when you type /destroycar?


Re: How do I make this code... - Join7 - 06.05.2011

It you're working your work, but want to check when I am in my vehicle to see "You're not in the vehicle! ", not me, it appears that I successfully remove vehicle.


Re: How do I make this code... - Calgon - 06.05.2011

pawn Код:
if(strcmp(cmd, "/destroycar", true)== 0)
    {
        if(PlayerInfo[playerid][pAdmin] > 1)
        {
            if(!IsPlayerInAnyVehicle(playerid))
                return SendClientMessage(playerid, COLOR_GRAD1, "You're not in the vehicle! ");
               
            new
                removeVeh = GetPlayerVehicleID(playerid);
               
            SendClientMessage(playerid, COLOR_GRAD1, "You have successfully removed the vehicle.");
            DestroyVehicle(removeVeh);
           
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "You are not an admin!");
        }
Is that what you're looking for?