SA-MP Forums Archive
stock IsPlayerOG - 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)
+--- Thread: stock IsPlayerOG (/showthread.php?tid=281303)



stock IsPlayerOG - samtey - 05.09.2011

Hi!

I need your help again! I want to create a stock!
That means, this kind of stock:

PHP код:
stock IsPlayerOG(playerid)
{
IsPlayerOG(playerid)

I know it's very incomplete! I already got an OG command:

PHP код:
CMD:og(playeridparams[])
{
    new
        
glevel[32], id;
    if(
PlayerInfo[playerid][pAdmin] >= 5)
    {
        if(
sscanf(params"us[32]"idglevel)) return SendClientMessage(playeridCOLOR_RED"USAGE: /og [id] [gangster level]");
        if(
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_RED"System: Invalid ID");
        new
            
str[128];
        
format(str128"System: %s [ID %d] has set %s [ID %d] gangsterlevel to %s."PlayerName(playerid), playeridPlayerName(id), idglevel);
        
SendClientMessage(playeridCOLOR_YELLOWstr);
        if(
INI_Open(getINI(playerid)))
        {
            
INI_WriteString("GangsterLvl"glevel);
            new
                
pts INI_ReadInt("RespectPts");
            if(
pts <= 90)
            {
                
INI_WriteInt("RespectPts"pts 10);
            }
            else
            {
                
INI_WriteInt("RespectPts"100);
            }
            
INI_Save();
            
INI_Close();
        }
        return 
1;
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");

So, any ideas how to do this kind of stock?


Re: stock IsPlayerOG - =WoR=Varth - 05.09.2011

Why don't you ust create a bool?
pawn Код:
new bool:IsPlayerOG[MAX_PLAYERS]
Please provide more information.


AW: stock IsPlayerOG - samtey - 05.09.2011

No man, I want it as stock!

'Cause I will need it later for my businesses! For example:
if(IsPlayerOG)
then the business can be bought


Re: stock IsPlayerOG - PrawkC - 05.09.2011

.. ? and why not just do
pawn Код:
if(IsPlayerOG[playierid])
^ using bool


Re: AW: stock IsPlayerOG - =WoR=Varth - 05.09.2011

Quote:
Originally Posted by samtey
Посмотреть сообщение
No man, I want it as stock!

'Cause I will need it later for my businesses! For example:
if(IsPlayerOG)
then the business can be bought
pawn Код:
new bool:IsPlayerOG[MAX_PLAYERS];

CMD:buybusiness(playerid,params[])
{
    if(IsPlayerOG[playerid])
    {
        //Buy business thinghy
    }
    return 1;
}



AW: stock IsPlayerOG - samtey - 05.09.2011

Ok guys, now we got a problem!

I want some businesses with IsPlayerOG, and some businesses without it! What now??


Re: AW: stock IsPlayerOG - =WoR=Varth - 05.09.2011

Quote:
Originally Posted by samtey
Посмотреть сообщение
Ok guys, now we got a problem!

I want some businesses with IsPlayerOG, and some businesses without it! What now??
What do you mean?


Re: stock IsPlayerOG - =WoR=Varth - 05.09.2011

That's /og command, not /buybusiness command.


Re: stock IsPlayerOG - Basicz - 05.09.2011

I understand what you want, use isplayerinrangeofpoint
pawn Код:
CMD:buybusiness(playerid,params[] ) {
    if ( IsPlayerInRangeOfPoint( playerid, 2.0, ogbusinesspos ) ) // og only buz
    {
        if ( !isplayerog[ playerid ] ) return SendClientMessage( playerid, -1, "building for og's only." );
    }

    // buybusiness thingy
    return 1;
}



Re: stock IsPlayerOG - Kingunit - 05.09.2011

He means that only OG's can buy a business I think.