[FS-ish] Simplest Duel command
#3

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.
Reply


Messages In This Thread
[FS-ish] Simplest Duel command - by Quest123 - 29.11.2009, 08:14
Re: [FS-ish] Simplest Duel command - by ImRico - 29.11.2009, 10:08
Re: [FS-ish] Simplest Duel command - by Luka P. - 29.11.2009, 11:38
Re: [FS-ish] Simplest Duel command - by DJDhan - 05.12.2009, 07:28
Re: [FS-ish] Simplest Duel command - by ToPhrESH - 17.04.2011, 18:48
Re: [FS-ish] Simplest Duel command - by Ironboy - 17.04.2011, 19:42

Forum Jump:


Users browsing this thread: 2 Guest(s)