[FilterScript] [FS]INGAME pickup maker
#1

PICKUP MAKER



WHAT IS IT?
Well as the title says it is a in-game pickup creator

HOW TO INSTALL THIS
Put the .pwn and .amx file in your filterscripts. then in server.cfg in the line filterscripts add PMaker

HOW TO USE THIS
Go ingame ,login as administrator using /rcon login <password> , type /pickup. When you save your positions go to Scriptfiles/Pickups.txt,copy all the text and paste in your script in ongamemodeinit().

DOWNLOAD LINK
http://www.solidfiles.com/d/68cdc185a5/
NO MIROIRS

OTHER INFO
Any bugs report them here And enjoy!
Reply
#2

Nice job
Reply
#3

Good Job
Reply
#4

Good try but you've designed it insufficiently for most purposes.

1.) You should have a dynamic system
2.) If you have as much copy and paste code as you have you have to know your doing something wrong a lot of this code can be simplified.
3.) Make a function to export the pickups to file all at one time

So for the first step you need to do some basic dynamic code setup usually this involves the following at the very least apart from possibly not requiring an enum (which you do).

- enum
- variable
- create function
- remove function

pawn Код:
// Define max number of pickups
#define         MAX_EDIT_PICKUPS        100

// Invalid editing pickup
#define         INVALID_PEDIT_ID        -1

// Enum pickup information
enum PICKUPINFO
{
    PickupID,
    PickupModel,
    PickupType,
    Float:PU_X,
    Float:PU_Y,
    Float:PU_Z
}

// Variable storing pickup data
new gPickupData[MAX_EDIT_PICKUPS][PICKUPINFO];

// Set default variables
public OnFilterScriptInit()
{
    for(new i = 0; i < MAX_EDIT_PICKUPS; i++)
    {
        gPickupData[i][PickupID] = INVALID_PEDIT_ID;
    }

}

// Add a new pickup
stock AddPickup(PModel, PType, Float:px, Float:py, Float:pz)
{
    // Find a open slot
    for(new i = 0; i < MAX_EDIT_PICKUPS; i++)
    {
        if(gPickupData[i][PickupID] != INVALID_PEDIT_ID) continue;
       
        // Slot found create pickup
        gPickupData[i][PickupID] = CreatePickup(PModel, PType, px, py, pz, 0);

                // Store all data for editing/saving
        gPickupData[i][PickupModel] = PModel;
        gPickupData[i][PickupType] = PType;
        gPickupData[i][PU_X] = px;
        gPickupData[i][PU_Y] = py;
        gPickupData[i][PU_Z] = pz;

        // Return the index in which the pickup is created
        return i;
    }
    print("Error: Tried to add too many pickups");
    return INVALID_PEDIT_ID;
}

// Remove a pickup
stock RemovePickup(index)
{
    if(gPickupData[index][PickupID] != INVALID_PEDIT_ID)
    {
        DestroyPickup(gPickupData[index][PickupID]);
        gPickupData[index][PickupID] = INVALID_PEDIT_ID);
        return 1;
    }
    print("Error: Tried to remove an invalid pickup");
    return INVALID_PEDIT_ID;
}
The rest is up to you but that should set you in the right direction any kind of system like this needs a reliable underlying system to control what your manipulating effectively.
Reply
#5

This is a very old script but I will update this surely.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)