[Code needed] Faction rank exception for /heal.
#1

Once again, i need help. I got a script, where you can get armour with /heal in a house, if the house has armour upgrade.

Well, i don't want everyone have full armour, only scripted faction leaders. So i need an exception in the /heal (armour only, not health) that only faction leaders can have armour by /heal in a house, and if possible, in faction HQ!

The /heal script where i want the exception, is this:

pawn Код:
//-----------------------------------[HEAL]-------------------------------------------------------------------------
    if(strcmp(cmd, "/heal", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new location = PlayerInfo[playerid][pLocal];
            if(!strlen(tmp))
            {
                if(location != 255)
                {
                    if(location < 99)
                    {

                        if(HouseInfo[location][hArm] == 1)
                        {
                            format(string, sizeof(string), "* %s puts on body armour.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            SetPlayerArmour(playerid, 100.0);
                        }
                        else
                        {
                            format(string, sizeof(string), "This place does not have armour upgrades.");
                            SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
                        }
                        if(HouseInfo[location][hHel] == 1)
                        {
Reply
#2

Dump, where did the fast response go?
Reply
#3

First of all, it's 'Bump', not Dump -.-.

And don't bump after for like 2 hours.

Try looking at your script, specifically, at the pInfo enum.
It clearly hold a value named 'pLeader'.

So, just put this at the beginning of the code:

pawn Код:
if(PlayerInfo[playerid][pLeader] == 1)
{
     // Your code
}
else
{
    SendClientMessage(playerid, 0x00FF0000, "you're not a faction leader!");
    return 1;
}
return 1;
Reply
#4

Quote:
Originally Posted by judothijs
Посмотреть сообщение
First of all, it's 'Bump', not Dump -.-.

And don't bump after for like 2 hours.

Try looking at your script, specifically, at the pInfo enum.
It clearly hold a value named 'pLeader'.

So, just put this at the beginning of the code:

pawn Код:
if(PlayerInfo[playerid][pLeader] == 1)
{
     // Your code
}
else
{
    SendClientMessage(playerid, 0x00FF0000, "you're not a faction leader!");
    return 1;
}
return 1;
Tried that, but now it's throwing up this:
pawn Код:
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2185) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2214) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2250) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2251) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2278) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2772) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2783) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2795) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2799) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2811) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2815) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2819) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2823) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2827) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2831) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2835) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2839) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2851) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2855) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2859) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2863) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2867) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2879) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2883) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2887) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Joni\Desktop\SA-MP Server Test\gamemodes\NLRP12.pwn(2899) : error 004: function "PlayerToPoint" is not implemented

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
This is what i did:
pawn Код:
//-----------------------------------[HEAL]-------------------------------------------------------------------------
    if(strcmp(cmd, "/heal", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new location = PlayerInfo[playerid][pLocal];
            if(!strlen(tmp))
            {
                if(location != 255)
                {
                    if(location < 99)
                    {
                    if(PlayerInfo[playerid][pLeader] == 1)
                        {
                        if(HouseInfo[location][hArm] == 1)
                        {
                            format(string, sizeof(string), "* %s puts on body armour.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            SetPlayerArmour(playerid, 100.0);
                        }
                        else
                        {
                            format(string, sizeof(string), "This place does not have armour upgrades. (/hu)");
                            SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
                            }
                            else
                            {
                                    SendClientMessage(playerid, 0x00FF0000, "You're not a faction leader!");
                                }
                        if(HouseInfo[location][hHel] == 1)
                        {
Reply
#5

Bump... This became dead
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)