PDA

View Full Version : change player weapon interior


N00bKiller
13/06/2013, 02:41 PM
I want to ask how to change the interior when a player enters somewhere inside like the casino.
Example: I went inside the casino and I cannot use my weapons cause it automatically rolled to fist for me so I can't even change to any of the weapons......
Here are my codes
public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
//Weapons in interiors
if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
SetPlayerArmedWeapon(playerid,0);
return 0;
}
return 1;
}

Sandiel
13/06/2013, 03:10 PM
I don't see where the problem is? What do you want to do exactly?

Guest123
13/06/2013, 03:23 PM
just like this ?

public OnPlayerUpdate(playerid)
{
if(GetPlayerInterior(playerid) != 0||1||2||3||4||5||6||7||8||9||10)
{
if(GetPlayerWeapon(playerid))
{
SetPlayerArmedWeapon(playerid,0);
}
}
return 1;
}

N00bKiller
13/06/2013, 03:33 PM
Means, when I enter an interior such as lspd (the yellow arrow). I tried to roll to my weapons to use, but it automatically rolled back to fist, lol I came here to rob cops with guns, not to punch with hands......

N00bKiller
13/06/2013, 04:02 PM
I want the weapons allowed to use in the interiors.

Vince
13/06/2013, 04:25 PM
Then remove that piece of code? What exactly is the problem?

ReVo_
13/06/2013, 05:08 PM
http://wiki.sa-mp.com/wiki/AllowInteriorWeapons

AllowInteriorWeapons(1) in OnGameModeInit

If you have a code where disallow you to use weapons in interior: remove it.

N00bKiller
13/06/2013, 06:17 PM
It came a lot of errors when I remove it, also it stopped working when I add on the "AllowInteriorWeapons(1)"