AllowInteriorWeapons(); possible bug?
#1

Well in my Gamemode i have set weapons to be disabled in interiors. But it doesnt work.

Can anyone test this? Because its really shitting me off that its not working.
Reply
#2

Quote:
Originally Posted by Enemy_Plus[SA:MP
]
Well in my Gamemode i have set weapons to be disabled in interiors. But it doesnt work.

Can anyone test this? Because its really shitting me off that its not working.
Really? I'll go test this ASAP, give me like two minutes.

EDIT: Alright, I guess it doesn't work, wow..

You could use OnPlayerUpdate..

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerInterior(playerid) > 0)
    {
      SetPlayerArmedWeapon(playerid, 0);
      return 1;
    }
    return 1;
}
Reply
#3

public OnPlayerUpdate is removed from 0.3, right?

EDIT: I was thinking of OnPlayerInfoChange(playerid);

umm, :< i guess i could use OnPlayerUpdate
Reply
#4

Quote:
Originally Posted by Enemy_Plus[SA:MP
]
public OnPlayerUpdate is removed from 0.3, right?

EDIT: I was thinking of OnPlayerInfoChange(playerid);

umm, :< i guess i could use OnPlayerUpdate
Just make sure not to do too many operations in OnPlayerUpdate, it tends to lag the server since it's called literally every second.
Reply
#5

Quote:
Originally Posted by (Emporium) Sky
Quote:
Originally Posted by Enemy_Plus[SA:MP
]
public OnPlayerUpdate is removed from 0.3, right?

EDIT: I was thinking of OnPlayerInfoChange(playerid);

umm, :< i guess i could use OnPlayerUpdate
Just make sure not to do too many operations in OnPlayerUpdate, it tends to lag the server since it's called literally every second.
Yeh, and the code which detects the weapon class's and gives them the weapons is 166 lines.. too big i think..... plus uses alot of if checks
Reply
#6

Quote:
Originally Posted by Enemy_Plus[SA:MP
]
Quote:
Originally Posted by (Emporium) Sky
Quote:
Originally Posted by Enemy_Plus[SA:MP
]
public OnPlayerUpdate is removed from 0.3, right?

EDIT: I was thinking of OnPlayerInfoChange(playerid);

umm, :< i guess i could use OnPlayerUpdate
Just make sure not to do too many operations in OnPlayerUpdate, it tends to lag the server since it's called literally every second.
Yeh, and the code which detects the weapon class's and gives them the weapons is 166 lines.. too big i think..... plus uses alot of if checks
What are you talking about?

OnPlayerUpdate process a lot of data and it can process even more data, just avoid saving/loading things with it and you are good.
Reply
#7

Quote:
Originally Posted by $ЂЯĢ
Quote:
Originally Posted by Enemy_Plus[SA:MP
]
Quote:
Originally Posted by (Emporium) Sky
Quote:
Originally Posted by Enemy_Plus[SA:MP
]
public OnPlayerUpdate is removed from 0.3, right?

EDIT: I was thinking of OnPlayerInfoChange(playerid);

umm, :< i guess i could use OnPlayerUpdate
Just make sure not to do too many operations in OnPlayerUpdate, it tends to lag the server since it's called literally every second.
Yeh, and the code which detects the weapon class's and gives them the weapons is 166 lines.. too big i think..... plus uses alot of if checks
What are you talking about?

OnPlayerUpdate process a lot of data and it can process even more data, just avoid saving/loading things with it and you are good.
Oh, I was under the understanding that it would lag your server if you did too many operations, my bad.
Reply
#8

Quote:
Originally Posted by (Emporium) Sky
Quote:
Originally Posted by $€ЯĢ
Quote:
Originally Posted by Enemy_Plus[SA:MP
]
Quote:
Originally Posted by (Emporium) Sky
Quote:
Originally Posted by Enemy_Plus[SA:MP
]
public OnPlayerUpdate is removed from 0.3, right?

EDIT: I was thinking of OnPlayerInfoChange(playerid);

umm, :< i guess i could use OnPlayerUpdate
Just make sure not to do too many operations in OnPlayerUpdate, it tends to lag the server since it's called literally every second.
Yeh, and the code which detects the weapon class's and gives them the weapons is 166 lines.. too big i think..... plus uses alot of if checks
What are you talking about?

OnPlayerUpdate process a lot of data and it can process even more data, just avoid saving/loading things with it and you are good.
Oh, I was under the understanding that it would lag your server if you did too many operations, my bad.
Nah. So I Recommend using more timers instead of dumping into OnPlayerUpdate(); Use More Timers Like Me

- (Jeff)
Reply
#9

Well, i'm using OnPlayerUpdate for three operations, if I really had to save / load a bunch of things every second, I suppose I would use timers, but for now my code is:

pawn Код:
public OnPlayerUpdate(playerid)
{
  if(GetPlayerInterior(playerid) > 0 && gTeam[playerid] != Admin)
    {
      SetPlayerHealth(playerid, 100);
      SetPlayerArmedWeapon(playerid, 0);
      return 1;
    }
    if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN && gTeam[playerid] != Admin)
    {
      SendClientMessage(playerid, red, "SERVER: You have been banned, Reason: Weapon Hacking. (Minigun)");
      Ban(playerid);
      return 1;
    }
    if(GetPlayerWeapon(playerid) == 35 && gTeam[playerid] != Admin)
    {
      SendClientMessage(playerid, red, "SERVER: You have been banned, Reason: Weapon Hacking. (RPG)");
      Ban(playerid);
      return 1;
    }
    return 1;
}
And it's fine to use it, as it's never going to lag just detecting a players weapons and banning / disarming them.
Reply
#10

hahaha well right now in the 'Generation WarZone' scripts OnPlayerUpdate(playerid) holds the chat flood check



pawn Код:
public OnPlayerUpdate(playerid)
{
if(Messages[playerid] == 10)
{
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid,name,sizeof(name));
SendClientMessage(playerid,RED,"You are now kicked for flooding");
format(str,sizeof(str),"%s(%d) has been kicked for flooding",name,playerid);
Kick(playerid);
print(str);
SendClientMessageToAll(RED,str);
return 1;
}

return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)