AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   News Board (https://forums.alliedmods.net/showthread.php?t=3553)

RPRaiden 07-09-2004 16:00

News Board
 
I've decided I wanted to create a simple plugin that is basicly a "Jobs" section for a imaginary newspaper.

Now the commands:

say "/viewjobs" = View the Current Jobs
say "/addjobs Title Specification" = Add a job with its description
say "/deljobs Title" = Delete a job only you added.

Im not sure of the best way to do this but I was thinking, to view the jobs simply use a menu, that will list the title of all jobs, you press number next to the title to see a submenu. Here is for the beta version "1.Specification, 2.Recruiter, 3.Go Back".
Now when you press 1 it pops up a personal message saying something like "[JobSpec]: The Specification Here" and goes back to menu.

Now when adding a job, it should remember the persons userid and keep the job open until he leaves or deletes it. The only person who can remove it is the one with the corrosponding userid. If you got a better system which is more efficient please tell me.

I posted this because I would like to know the best way for a nub like me to go around this.

EKS 07-09-2004 17:08

Using userid is no good solution, either use user index or authid.

AssKicR 07-09-2004 19:05

Quote:

Originally Posted by EKS
Using userid is no good solution, either use user index or authid.

he prolly ment authid..

RPRaiden 07-09-2004 19:34

I started making it but I got beaten to it before I started so Im thinking of a new project

Code:

/********************************
*        News Board Plugin        *
*        Author: RPRaiden        *
*        Date: 09 July 2004        *
*        Version: 1.0 Beta        *
*                                *
********************************/
#include <amxmodx>

public add_job{
}

public view_job{
}

public del_Job{
}

public handlesay(HLCommand, HLData, HLUserName, UserIndex) {
        new Command[MAX_COMMAND_LENGTH];
        new Speech[MAX_DATA_LENGTH];
        new Data[MAX_DATA_LENGTH];
        new User[MAX_NAME_LENGTH];
        new Name[MAX_NAME_LENGTH];
        new Text[MAX_TEXT_LENGTH];

        convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
        convert_string(HLData, Speech, MAX_DATA_LENGTH);
        convert_string(HLData,Data,MAX_DATA_LENGTH);
        convert_string(HLUserName,User,MAX_NAME_LENGTH);
        convert_string(HLUserName, Name, MAX_NAME_LENGTH);

        if ( (strcasestr(Speech, "/addjob", User)!= -1) ) {
                snprintf(Text, MAX_TEXT_LENGTH, "[JOB] %s has added a job! Type /viewjobs to read!", User);
                say(Text);
                add_job(UserIndex);
        } else if ( (strcasestr(Speech, "/viewjob", User)!= -1) ) {
                view_job(UserIndex)
        } else if ( (strcasestr(Speech, "/deljob", User)!= -1) ) {
                del_job(UserIndex)
        }
}


public plugin_init () {
        register_plugin("RP Job Board","1.0 Beta","RPRaiden")
        plugin_registercmd("say","handlesay",ACCESS_ALL);


AssKicR 07-09-2004 19:41

that looks horribly like adminmod code

RPRaiden 07-09-2004 19:44

I based it upon a plugin I thought was amx but was am. I dont know the amx code but I recently learned c++ so it makes sense to me, I didnt realise :D


All times are GMT -4. The time now is 14:50.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.