AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved World not allowed (https://forums.alliedmods.net/showthread.php?t=294176)

JanDev 02-21-2017 16:50

World not allowed
 
I'm pretty new to this forum, but I hope you can help me a bit :)

So I've modified a little knife plugin for me and my friends on a LAN server and I get some errors.

Code:

public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));

        if (GetClientTeam(client) > 1 && !IsPlayerAlive(client))
        {
                return;
        }
       
        new iWeapon = GetPlayerWeaponSlot(client, 2);
        new iItem;
       
        switch(weapon_choose[client]) {
                case 1: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_bayonet");}
                case 2: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_gut");}
                case 3: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_flip");}
                case 4: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_m9_bayonet");}
                case 5: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_karambit");}
                case 6: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_tactical");}
                case 7: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_butterfly");}
                case 8: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_push");}
                case 9: if(IsValidEntity(iWeapon) && iWeapon != INVALID_ENT_REFERENCE)
                {RemovePlayerItem(client, iWeapon), RemoveEdict(iWeapon), iItem = GivePlayerItem(client, "weapon_knife_survival_bowie");}
                default: {return;}
        }
        EquipPlayerWeapon(client, iItem);
}

I get this error (sometimes, I cant meassure when.):

Code:

L 02/21/2017 - 16:00:50: [SM] Exception reported: World not allowed
L 02/21/2017 - 16:00:50: [SM] Blaming: KNIFE.smx
L 02/21/2017 - 16:00:50: [SM] Call stack trace:
L 02/21/2017 - 16:00:50: [SM]  [0] EquipPlayerWeapon
L 02/21/2017 - 16:00:50: [SM]  [1] Line 359, /home/groups/sourcemod/upload_tmp/phpjiKbkU.sp::PlayerSpawn


OciXCrom 02-21-2017 17:13

Re: World not allowed
 
No matter how new you are, you should know the difference between AMXModX and SourceMod.

JanDev 02-21-2017 17:29

Re: World not allowed
 
Quote:

Originally Posted by OciXCrom (Post 2497301)
No matter how new you are, you should know the difference between AMXModX and SourceMod.

I know the difference. I'm just too dumb/tired to read.
I'll repost it in the right forum tomorrow... (Maybe anyone writes a solution till tomorrow idk, but I need to sleep now.)


All times are GMT -4. The time now is 20:48.

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