SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 23/02/2019, 10:57 AM   #14081
Hammad123
Big Clucker
 
Join Date: Jan 2017
Location: Locating...
Posts: 55
Reputation: 0
Default Re: Looking for scripters/helpers? Post here!

I need a /reports command which shows the last 10 reports in a dialog box including "Plaer" "Reported by" "Reason" - these three must be the headings.
I'll give one of my admin commands

pawn Code:
COMMAND:jail(playerid, params[])
{
    if(playerData[playerid][playerLoggedIn])
    {
        if(playerData[playerid][playerLevel] >= 1)
        {
            // Set-up our variables etc
            new PlayerToJail, JailTime, Reason[128], Msg[328], Name[24], jailedBy[24], MsgAll[328];
 
            if (sscanf(params, "uis[128]", PlayerToJail, JailTime, Reason))
            {
                // Incorrect params used
                SendClientMessage(playerid, COLOR_ORANGE, "Usage: \"jail <PlayerToJail> <JailTime> <Reason>\"");
            }
            else
            {
                if (IsPlayerConnected(PlayerToJail)) // If the player is a valid playerid (he's connected)
                {
                    if(playerData[PlayerToJail][playerLoggedIn])
                    {
                        if(playerData[playerid][playerLevel] >= playerData[PlayerToJail][playerLevel])
                        {
                            if(JailTime >= 1)
                            {
                                // Get the name of the player who jailed the player
                                GetPlayerName(playerid, jailedBy, sizeof(jailedBy));
                               
                                // Get the name of the player who's being sent to jail
                                GetPlayerName(PlayerToJail, Name, sizeof(Name));
 
                                for(new p; p < MAX_PLAYERS; p++)
                                {
                                    new pName[24];
                                    GetPlayerName(p, pName, sizeof(pName));
       
                                    if(!strcmp(pName, Name))
                                    {
                                        // Send the jailed player a message who jailed him, why he's been jailed and how long
                                        format(Msg, sizeof(Msg), "{A9C4E4}An administrator has jailed you for %i seconds {FE9A2E}[REASON: %s]{FFFFFF}", JailTime, Reason);
                                        SendClientMessage(p, COLOR_WHITE, Msg);
                                    }
                                    else
                                    {
                                        format(MsgAll, sizeof(MsgAll), "{A9C4E4}An administrator has sent %s(%i) to jail.", Name, PlayerToJail);
                                        SendClientMessage(p, COLOR_WHITE, MsgAll);
                                    }
                                }
                               
                                new aMsg[300];
                                for (new i=0; i<MAX_PLAYERS; i++)
                                {
                                    if (playerData[i][playerLevel] >= 1)
                                    {
                                        format(aMsg, sizeof(aMsg), "{FF0770}[ADMIN] {FFFFFF}%s(%i) has jailed %s(%i) for %i seconds {FE9A2E}[REASON: %s]{FFFFFF}", playerData[playerid][playerNamee], playerid, playerData[PlayerToJail][playerNamee], PlayerToJail, JailTime, Reason);
                                        SendClientMessage(i, COLOR_WHITE, aMsg);
                                    }
                                }      
 
                                // Call jail function
                                sendPlayerJail(PlayerToJail, JailTime, playerid, 0);
                                playerData[PlayerToJail][playerAdminJailed] = 1;
                               
                                ShowPlayerDialog(PlayerToJail, 91827, DIALOG_STYLE_MSGBOX, "Admin Jailed", "You have been sent to jail by an administrator.", "OK", "");
                               
                                new log[250];
                                format(log, sizeof(log), "%s(%i) has jailed %s(%i) for %i seconds", playerData[playerid][tempAdminName], playerid, Name, PlayerToJail, JailTime);
                                SendAdminText(playerid, log);
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot use this command on that player.");
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}Jail time must be at least 1 second.");
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not logged in!");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not online!");
                }
            }
        }
        else
        {
            return 0;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
    }
 
    return 1;
}

Btw only admin level 1+ should be able to use /reports

Please try to DM this script to me on aaaax#0296
Hammad123 is offline   Reply With Quote
Old 23/02/2019, 12:50 PM   #14082
thegamenard
Little Clucker
 
Join Date: Aug 2010
Posts: 24
Reputation: 0
Default Re: Looking for scripters/helpers? Post here!

Anyone interested in a new RP server? I've got years of experience coding and I just wanted to see if there are people out there interested in a new RP server. I miss the old times and I want to create something new and unique yet simplistic. I've got all the funds necessary to keep the server running.

Interested? Please PM me here.
thegamenard is offline   Reply With Quote
Old 23/02/2019, 05:17 PM   #14083
AliBro
Big Clucker
 
Join Date: Aug 2015
Location: San Fierro
Posts: 55
Reputation: 12
Default Re: Looking for scripters/helpers? Post here!

I'm looking for very good/professional mappers to RP server, which they have knowledge and they can edit and creating objects/exterior/interior, they are doing aestethics work, which are perfectly fitted. Contact via discord: Sons#9051
__________________
AliBro is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion For 'People Looking For Scripters/Helpers' freddy smyth General 12 04/05/2014 03:51 PM
Need help on Helpers DerickClark Scripting Help 2 08/02/2013 12:55 AM
Need help on Helpers DerickClark Scripting Help 4 23/01/2013 02:01 AM
Searching For Scripters [To All Scripters] Drizzy Help Archive 3 06/06/2010 03:14 PM


All times are GMT. The time now is 02:55 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.