AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Spawnpoints Creator - Easy to use spawn points managing library (https://forums.alliedmods.net/showthread.php?t=147542)

Seta00 05-29-2011 12:24

Re: Spawnpoints Creator - Easy to use spawn points managing library
 
Quote:

Originally Posted by Chanz (Post 1477164)
Could you add an array that contains the orginal spawnpoints of the map?
I'd like to see what spawn points the mapper set and those I set with this lib.
Also a reset and/or undo would be nice. :-)

This library has nothing to do with actual spawn points in the map, it just facilitates the handling of custom points in the map. I guess the name is misleading, but I don't know what else to call it (points creator? :P).

Peace-Maker 11-03-2012 11:47

Re: Spawnpoints Creator - Easy to use spawn points managing library
 
1 Attachment(s)
Thanks for this. After switching to this library, the code isn't that bloated anymore.
I had to fix some issues though:
  • The __showSpawnsSprite glowing sprite is only precached in OnPluginStart where you initialize the library. After a mapchange the glows show some random model like some viewmodel or similar. I sepereated the precaching into another stock SC_SetSpawnSprite(showSpawnsSprite = -1).
  • The KV handle isn't closed after writing to the config file.
  • The main menu command handler is missing a return Plugin_Handled;
  • If no config dir given, it still uses the plugin name with spaces instead of the one with replaced underscores.
Additionally the rotation of the spawnpoint was important, so that's saved now too.

Despirator 11-04-2012 15:17

Re: Spawnpoints Creator - Easy to use spawn points managing library
 
i would prefer to see this too

PHP Code:

new __nextSpawnpoint;

stock SCError:SC_GetNextSpawnPoint(Float:spawn[3], Float:rotation[3]) {
    if (!
__initialized)
        
ThrowError("Spawnpoint Creator not initialized");
    
    new 
__array GetArraySize(__spawns);
        
    if (!
__array)
        return 
SC_NoSpawns;
    
    if (
__nextSpawnpoint >= __array)
    {
        
__nextSpawnpoint 0;
    }
    
GetArrayArray(__spawns__nextSpawnpointspawn);
    
GetArrayArray(__rotations__nextSpawnpointrotation);
    
__nextSpawnpoint++;
    return 
SC_NoError;



rekcah 04-10-2021 20:46

Re: Spawnpoints Creator - Easy to use spawn points managing library
 
1 Attachment(s)
I've attempted to update the syntax, not sure if I messed it up or not tho, seems to still work properly in the plugins I'm using it with. its the position and rotation version.


All times are GMT -4. The time now is 18:26.

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