stock IsPlayerOG
#1

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?
Reply
#2

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

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
Reply
#4

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

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;
}
Reply
#6

Ok guys, now we got a problem!

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

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?
Reply
#8

That's /og command, not /buybusiness command.
Reply
#9

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;
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)