SA-MP Forums Archive
[FS-ish] Simplest Duel 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FS-ish] Simplest Duel command (/showthread.php?tid=110971)



[FS-ish] Simplest Duel command - Quest123 - 29.11.2009

Just a little command i made when i was just chilling, its just a simple command " /duel " and it will teleport to a certain base ball arena where its great to duel, it will give you full Armour and health and reset your pervious weapons and give you the weapons Sawn-Off, Tec9, Desert Eagle, i would recommend this for a simple server or so, its simple but pretty effective, i couldn't put it in a filterscript since i am new to scripting, but here is still something you could add.

Features:
Код:
 if(strcmp(cmdtext, "/duel") == 0)
  {
    new name[24];
    GetPlayerName(playerid,name,24);
    SetPlayerPos(playerid, 1394.4448, 2159.5742, 9.7578,89.3516);
    format(string,sizeof(string),"%s has just typed /duel!",name);
		SendPlayerFormattedText(playerid,"Welcome to dueling arena", 0);
    GameTextForPlayer(playerid,"~w~Welcome to ~r~/Duel.",5000,5);
		SendClientMessageToAll(0xFFFFFFFF,string);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 26, 500);
    GivePlayerWeapon(playerid, 32, 500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
		return 1;
		}



Re: [FS-ish] Simplest Duel command - ImRico - 29.11.2009

Great!

If i want to make it for only 1337 admins it should be like this? :
if(strcmp(cmdtext, "/duel") == 1337)
{
new name[24];
GetPlayerName(playerid,name,24);
SetPlayerPos(playerid, 1394.4448, 2159.5742, 9.7578,89.3516);
format(string,sizeof(string),"%s has just typed /duel!",name);
SendPlayerFormattedText(playerid,"Welcome to dueling arena", 0);
GameTextForPlayer(playerid,"~w~Welcome to ~r~/Duel.",5000,5);
SendClientMessageToAll(0xFFFFFFFF,string);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 26, 500);
GivePlayerWeapon(playerid, 32, 500);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}


Re: [FS-ish] Simplest Duel command - Luka P. - 29.11.2009

Quote:
Originally Posted by ImRico
Great!

If i want to make it for only 1337 admins it should be like this? :
if(strcmp(cmdtext, "/duel") == 1337)
{
new name[24];
GetPlayerName(playerid,name,24);
SetPlayerPos(playerid, 1394.4448, 2159.5742, 9.7578,89.3516);
format(string,sizeof(string),"%s has just typed /duel!",name);
SendPlayerFormattedText(playerid,"Welcome to dueling arena", 0);
GameTextForPlayer(playerid,"~w~Welcome to ~r~/Duel.",5000,5);
SendClientMessageToAll(0xFFFFFFFF,string);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 26, 500);
GivePlayerWeapon(playerid, 32, 500);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
I'm going to use PlayerInfo..pAdmin like in GF.
You must define COLOR_GRAD and COLOR_WHITE.

pawn Код:
if(strcmp(cmdtext, "/duel") == 0)
{
    if(PlayerInfo[playerid][pAdmin] != 1337) return SendClientMessage(playerid, COLOR_GRAD, "Only 1337 admin levels can use this command!");
   
    new name[24];
    GetPlayerName(playerid,name,24);
   
    SetPlayerPos(playerid, 1394.4448, 2159.5742, 9.7578,89.3516);
   
    format(string,sizeof(string),"%s has just typed /duel!",name);

    SendClientMessageToAll(COLOR_WHITE,string);
    SendClientMessage(playerid, COLOR_WHITE, "Welcome to duel arena!");

    GameTextForPlayer(playerid,"~w~Welcome to ~r~/duel.",5000,5);

    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 26, 500);
    GivePlayerWeapon(playerid, 32, 500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    return 1;
}

@ABCitrus:

First, you don't need to create a topic for just one simple cmd.
Second, you are using SendPlayerFormattedText, and you didn't give the code of that function.
Third, you could indentify script.


Re: [FS-ish] Simplest Duel command - DJDhan - 05.12.2009

Nice!



Re: [FS-ish] Simplest Duel command - ToPhrESH - 17.04.2011

Very very basic. Could have made this in 1 minute, but nice work.


Re: [FS-ish] Simplest Duel command - Ironboy - 17.04.2011

Nice