Disable get weapons/ armour from enforcer etc - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Disable get weapons/ armour from enforcer etc (
/showthread.php?tid=71924)
Disable get weapons/ armour from enforcer etc -
hipy - 04.04.2009
Hello
I want to disalbe the system that when you enter an enforcer you get a shotgun and armour.
Like on stunt servers this isnt very handy
how can i do that?
Re: Disable get weapons/ armour from enforcer etc -
BigPoncho - 04.04.2009
Just remove the code.
Look in OnPlayerEnterVehicle and look for the vehicle ID 427.
Look for a code similar to this one:
Код:
if(IsPlayerInVehicle(playerid, 427))
{
GivePlayerWeapon(playerid, 25, 100);
SetPlayerArmour(playerid, 100.0);
}
return 1;
Re: Disable get weapons/ armour from enforcer etc -
MenaceX^ - 04.04.2009
Quote:
|
Originally Posted by BigPoncho
Just remove the code.
Look in OnPlayerEnterVehicle and look for the vehicle ID 427.
Look for a code similar to this one:
Код:
if(IsPlayerInVehicle(playerid, 427))
{
GivePlayerWeapon(playerid, 25, 100);
SetPlayerArmour(playerid, 100.0);
}
return 1;
|
And if the player had 50 armor before?..
Would be better with a timer, because the public OnPlayerEnterVehicle gets called when a player presses f/enter near the vehicle, doesn't matter if he sits in the car or not.
Re: Disable get weapons/ armour from enforcer etc -
hipy - 05.04.2009
My script does not have that code!
Re: Disable get weapons/ armour from enforcer etc -
dre$tA - 05.04.2009
Yeah it's from Single Player, but you can disable it:
Код:
// Add on top of the script
new Float:StoreArmour[MAX_PLAYERS];
new StoreWeapons[MAX_PLAYERS][13][2];
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Model = GetVehicleModel(vehicleid);
if(Model == 427 && !ispassenger)
{
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, StoreWeapons[playerid][i][0], StoreWeapons[playerid][i][1]);
}
GetPlayerArmour(playerid, StoreArmour[playerid]);
}
return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new Model = GetVehicleModel(GetPlayerVehicleID(playerid));
if(Model == 427)
{
ResetPlayerWeapons(playerid);
for (new i = 0; i < 13; i++)
{
GivePlayerWeapon(playerid, StoreWeapons[playerid][i][0], StoreWeapons[playerid][i][1]);
}
SetPlayerArmour(playerid, StoreArmour[playerid]);
}
}
return 1;
}
Edit: Edited the code, it's untested but should work
Re: Disable get weapons/ armour from enforcer etc -
Jefff - 05.04.2009
Quote:
|
Originally Posted by MenaceX^
Quote:
|
Originally Posted by BigPoncho
Just remove the code.
Look in OnPlayerEnterVehicle and look for the vehicle ID 427.
Look for a code similar to this one:
Код:
if(IsPlayerInVehicle(playerid, 427))
{
GivePlayerWeapon(playerid, 25, 100);
SetPlayerArmour(playerid, 100.0);
}
return 1;
|
And if the player had 50 armor before?..
|
It sets armour to 100 not give u another 100