Help Scripting - 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)
+--- Thread: Help Scripting (
/showthread.php?tid=657813)
Help Scripting -
travistaylor - 15.08.2018
Hello guys,I made an script when you join passenger,you can change your weapons to g-shoot.
But I want to disable from using some weapons in gshoot like deagle cuz it rapid fires!
Can I get some help?
Code:
else if(newstate == PLAYER_STATE_PASSENGER)
{
new weapID = GetPlayerWeapon(playerid);
SetPVarInt(playerid, "switch_WeaponID", weapID);
if(IsBulletWeapon(weapID)) SendClientMessage(playerid, COLOR_JEFE, "[IncredibleRP] {FFFFFF}You can switch weapons using ~k~~CONVERSATION_YES~ / ~k~~CONVERSATION_NO~.");
new driverid = GetVehicleDriver(GetPlayerVehicleID(playerid));
Code:
switch(GetPlayerWeapon(playerid))
{
case 34:
SetPlayerArmedWeapon(playerid, GetScriptWeapon(playerid));
default:
SetPlayerArmedWeapon(playerid, 0);
}
Re: Help Scripting -
brauf - 15.08.2018
PHP Code:
/* MADE BY BRAUF */
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER) // if passenger state is = passenger
{
if(GetPlayerWeapon(playerid) == WEAPON_DEAGLE) // if player's weapon is a desert eagle
{
SetPlayerArmedWeapon(playerid, 0); // set the weapon to a fist
}
}
return 1;
}
Re: Help Scripting -
travistaylor - 15.08.2018
thanks <3
Re: Help Scripting -
travistaylor - 15.08.2018
Quote:
Originally Posted by brauf
PHP Code:
/* MADE BY BRAUF */
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER) // if passenger state is = passenger
{
if(GetPlayerWeapon(playerid) == WEAPON_DEAGLE) // if player's weapon is a desert eagle
{
SetPlayerArmedWeapon(playerid, 0); // set the weapon to a fist
}
}
return 1;
}
|
Can you read pms?