how do i make a simple /fine and /arrest command for police class?
#4

pawn Код:
CMD:fine(playerid, params[]) //this is the new syntax for zcmd
    {
    new level, id,fine;
    if(sscanf(params, "udd", id, level,fine)) //changed from 'udd' to 'udd'
    {
        if(gTeam[playerid] ==  TEAM_POLICE) // Change according to your class definition
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid] [money]");
        }
        if(gTeam[playerid] !=  TEAM_POLICE) // Change according to your class definition
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not a part of Police force!");
        }
    }
    else
    {
        if(PlayerInfo[playerid][pAdmin] >= 2)
        { // no need for tmp here, you already got 'level' (skinid?) by sscanf
            new str[64];
            format(str, sizeof(str), "Admin: %s has fined %s with %d$", PlayerName(playerid),PlayerName(id),money);
            SendClientMessageToAll(COLOR_WHITE,str)
            GivePlayerMoney(id,-money); // Change this to your Money given or PlayerInfo Cash ++
        }
    }
    return 1;
    }

    // Add this anywhere in the GM or bottom
    stock PlayerName(playerid)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        return name;
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)