SA-MP Forums Archive
error to change GivePlayerWeapon GivePlayerValidWeapon - 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: error to change GivePlayerWeapon GivePlayerValidWeapon (/showthread.php?tid=509023)



error to change GivePlayerWeapon GivePlayerValidWeapon - NTVbeleza - 25.04.2014

Help my GM does not allow GivePlayerWeapon, so I put a GivePlayerValidWeapon but I get this error.

Code:
C:\Users\NTV\Desktop\Lumberjack.pwn(123) : error 017: undefined symbol "GivePlayerValidWeapon"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


I define a new GivePlayerValidWeapon, but I do not agree


Код:
if(GetPlayerSkin(playerid) == 260)
  	{
  	  GivePlayerValidWeapon(playerid, 9, 1);   ((Line of error
	RemoveBuildingForPlayer(playerid, 341,-1168.7000000,-1407.7000000,126.6000000, 0.0);
   	SendClientMessage(playerid, COLOR_GREY, "* you picked up a chainsaw");
   	ApplyAnimation(playerid,"BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
I need to change giveplayerweapon by giveplayervalidweapon

use a job because of my gm fs gun takes my job.


Re: error to change GivePlayerWeapon GivePlayerValidWeapon - Tayab - 25.04.2014

You don't have GivePlayerValidWeapon defined..


Add this in the bottom of your script.
pawn Код:
stock GivePlayerValidWeapon(playerid,weaponid,ammo)
{
    if(IsPlayerConnected(playerid){
        if(!(-1 < weaponid < 47)) return 0;
        GivePlayerWeapon(playerid,weaponid,ammo);
    }
    return 1;
}



Re: error to change GivePlayerWeapon GivePlayerValidWeapon - NTVbeleza - 25.04.2014

tk



Код:
C:\Users\NTV\Desktop\lumberjack.pwn(566) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           1988 bytes
Code size:            16260 bytes
Data size:             3788 bytes
Stack/heap size:      16384 bytes; estimated max. usage=97 cells (388 bytes)
Total requirements:   38420 bytes

1 Warning.

Код:
  	stock GivePlayerValidWeapon(playerid,weaponid,ammo)
{
    if(-1 < weaponid < 47)
    {
        GivePlayerWeapon(playerid,weaponid,ammo);
        return 1;
    }else return 0;
    return 1;   (((Line of error
}