Jump to content
  • 0

Question

Posted

public OnPlayerCommandText(playerid, cmdtext[])

{

    if(strcmp(cmdtext, "/banme", true) == 0)

    {

        // Ban the player who types this command.

        Ban(playerid);

        return 1;

    }

}

2 answers to this question

Recommended Posts

Posted
#include <a_samp>
#define bandana 1000

#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9,%10) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9,%10)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)

main()
{
	print("[FS]Hold Bandana by Lucian.");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/bandana", true) == 0)
	{
		ShowPlayerDialog(playerid,bandana,DIALOG_STYLE_LIST,"Bandana","Bandana 1\nBandana 2\nBandana 3\nBandana 4\nBandana 5\nBandana 6\nBandana 7\nBandana 8\nBandana 9\nBandana 10\nRemove Bandana","OK","");
		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid==bandana)
	{
		if(response)
		{
				if(listitem==0)
				{
					SetPlayerAttachedObject( playerid, 0, 18917, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==1)
				{
					SetPlayerAttachedObject( playerid, 0, 18913, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==2)
				{
					SetPlayerAttachedObject( playerid, 0, 18916, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==3)
				{
					SetPlayerAttachedObject(playerid, 0, 18915, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==4)
				{
					SetPlayerAttachedObject(playerid, 0, 18912 , 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==5)
				{
					SetPlayerAttachedObject(playerid, 0, 18911 , 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==6)
				{
					SetPlayerAttachedObject( playerid, 0, 18914, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==7)
				{
					SetPlayerAttachedObject(playerid, 0, 18918, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==8)
				{
					SetPlayerAttachedObject(playerid, 0, 18920 , 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==9)
				{
					SetPlayerAttachedObject(playerid, 0, 18919 , 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
				}
				if(listitem==10)
				{
					for(new i;i<5;i++) RemovePlayerAttachedObject(playerid,i);
				}
		}
	}
	return 0;
}


public OnGameModeExit()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	{
        if(IsPlayerConnected(i))
        {
            StopPlayerHoldingObject(i);
        }
	}
	return 0;
}

i0418xcttya707ofg.jpg

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.