GetWeaponSlot Not found.. - 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: GetWeaponSlot Not found.. (
/showthread.php?tid=598514)
GetWeaponSlot Not found.. -
IndependentGaming - 13.01.2016
Hello, when I try to start the server it is showing this in the server logs:
PHP код:
[22:22:23] [debug] Run time error 19: "File or function is not found"
[22:22:23] [debug] GetWeaponSlot
[22:22:23] [debug] IsVehicleOccupied
[22:22:23] Script[gamemodes/Progress.amx]: Run time error 19: "File or function is not found"
[22:22:23] Number of vehicle models: 0
How can I fix this ?
Re: GetWeaponSlot Not found.. -
lucamsx - 13.01.2016
Quick search shows these are custom functions and you need to add it to gamemode yourself.
weapon slot:
https://sampforum.blast.hk/showthread.php?tid=166165
is vehicle occupied:
http://pastebin.com/xhEvBtSU
Re: GetWeaponSlot Not found.. -
Kathleen - 13.01.2016
Add those two stocks to your script and its good to go.
Код:
stock GetWeaponSlot(weaponid)
{
new slot;
switch(weaponid){
case 0, 1: slot = 0; // No weapon
case 2 .. 9: slot = 1; // Melee
case 22 .. 24: slot = 2; // Handguns
case 25 .. 27: slot = 3; // Shotguns
case 28, 29, 32: slot = 4; // Sub-Machineguns
case 30, 31: slot = 5; // Machineguns
case 33, 34: slot = 6; // Rifles
case 35 .. 38: slot = 7; // Heavy Weapons
case 16, 18, 39: slot = 8; // Projectiles
case 42, 43: slot = 9; // Special 1
case 14: slot = 10; // Gifts
case 44 .. 46: slot = 11; // Special 2
case 40: slot = 12; // Detonators
default: slot = -1; // No slot
}
return slot;
}
stock IsVehicleOccupied(vid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vid)) return 1;
}
return 0;
}