SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/02/2020, 12:18 PM   #1
Zhesty
Little Clucker
 
Join Date: Jan 2020
Posts: 3
Reputation: 0
Default error while compiling

hello, anyone can help me?

Code:
Code:
CMD:dropgun(playerid, params[])
{
	new
	world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
	if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
 	new GunID = GetPlayerWeapon(playerid);
  	new GunAmmo = GetPlayerAmmo(playerid);
   	if(GunID > 0 && GunAmmo != 0)
    {
    	new f = MAX_OBJ+1;
     	for(new a = 0; a < MAX_OBJ; a++)
      	{
       		if(dGunData[a][ObjPos][0] == 0.0)
         	{
          		f = a;
            	break;
            }
		}
  		if(f > MAX_OBJ) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can not drop your gun at the moment. (max limit exceeded)");
        RemovePlayerWeapon(playerid, GunID);
		dGunData[f][ObjData][0] = GunID;
		dGunData[f][ObjData][1] = GunAmmo;
		
		dGunData[f][ObjInt] = interior;
		dGunData[f][ObjWorld] = world;
		
		GetPlayerPos(playerid, dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]);
		dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-1, 93.7, 120.0, 120.0, world, interior, -1, 200.0, 0.0);
		new buffer[50];
		format(buffer, sizeof(buffer), "You threw your %s on the ground.", GunNames[dGunData[f][ObjData][0]]);
		SendClientMessage(playerid, -1, buffer);
		
		// Logging bans
    	new dropgunstring[256];
    	
   		new Hour, Minute, Second;
		gettime(Hour, Minute, Second);

		format(dropgunstring, sizeof(dropgunstring), "[%d:%d:%d] %s threw his %s on the ground.", Hour, Minute, Second, GetName(playerid), GunNames[dGunData[f][ObjData][0]]);
		DropGunLog(dropgunstring);
		// -------------------------------------------------------
	}
   	return 1;
}
Error:
Code:
C:\Users\Asus\Downloads\Compressed\TEst Server\gamemodes\Roleplay.pwn(4656) : error 012: invalid function call, not a valid address
C:\Users\Asus\Downloads\Compressed\TEst Server\gamemodes\Roleplay.pwn(4656) : warning 215: expression has no effect
C:\Users\Asus\Downloads\Compressed\TEst Server\gamemodes\Roleplay.pwn(4656) : warning 215: expression has no effect
C:\Users\Asus\Downloads\Compressed\TEst Server\gamemodes\Roleplay.pwn(4656) : error 001: expected token: ";", but found ")"
C:\Users\Asus\Downloads\Compressed\TEst Server\gamemodes\Roleplay.pwn(4656) : error 029: invalid expression, assumed zero
C:\Users\Asus\Downloads\Compressed\TEst Server\gamemodes\Roleplay.pwn(4656) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Error Line:
Code:
        RemovePlayerWeapon(playerid, GunID);
Zhesty is offline   Reply With Quote
Old 26/02/2020, 12:29 PM   #2
Slawiii
Huge Clucker
 
Slawiii's Avatar
 
Join Date: May 2015
Location: Morocco, Missour
Posts: 288
Reputation: 16
Default Re: error while compiling

Show stock RemovePlayerWeapon code
__________________
if you wanna test NEF script check it here:

RCON password: gn2pk69y

HostName: [Ultra-h.com]..:: NEF ::.. ×Stunt/DM/Race/Minigame
Address: sampza.net:7776
Players: 0 / 420
Ping: 110
Mode: TdmDerbyRaceCNRFunStuntFreeroa
Language: English
Slawiii is offline   Reply With Quote
Old 26/02/2020, 12:34 PM   #3
Zhesty
Little Clucker
 
Join Date: Jan 2020
Posts: 3
Reputation: 0
Default Re: error while compiling

when i try to find text "stock RemovePlayerWeapon" but Text Not Found
Zhesty is offline   Reply With Quote
Old 26/02/2020, 12:44 PM   #4
Slawiii
Huge Clucker
 
Slawiii's Avatar
 
Join Date: May 2015
Location: Morocco, Missour
Posts: 288
Reputation: 16
Default Re: error while compiling

you need to found it

what includes are you using ?
__________________
if you wanna test NEF script check it here:

RCON password: gn2pk69y

HostName: [Ultra-h.com]..:: NEF ::.. ×Stunt/DM/Race/Minigame
Address: sampza.net:7776
Players: 0 / 420
Ping: 110
Mode: TdmDerbyRaceCNRFunStuntFreeroa
Language: English
Slawiii is offline   Reply With Quote
Old 26/02/2020, 12:54 PM   #5
Zhesty
Little Clucker
 
Join Date: Jan 2020
Posts: 3
Reputation: 0
Default Re: error while compiling

#include <a_samp>
#include <zcmd>
#include <YSI\y_ini>
#include <YSI\y_iterate>
#include <sscanf2>
#include <streamer>
#include <fader>
#include <mSelection>
#include <FloodControl>
Zhesty is offline   Reply With Quote
Old 26/02/2020, 01:31 PM   #6
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 811
Reputation: 79
Default Re: error while compiling

RemovePlayerWeapon Doesn't have to be a stock. Have you also searched on just RemovePlayerWeapon without stock?
Using stock in your gamemode other than in includes is just bad programming.
A lot of people don't seem to know what stock does/mean in samp so take a look here for more information about stock functions: https://forum.sa-mp.com/showthread.php?t=570635
__________________
Coming soon (5-21-2020):

Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Official Live Beta Release Date: 21th of May, 2020
Discord
jasperschellekens is offline   Reply With Quote
Old 26/02/2020, 02:11 PM   #7
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,528
Reputation: 1642
Default Re: error while compiling

Quote:
Originally Posted by jasperschellekens View Post
RemovePlayerWeapon Doesn't have to be a stock. Have you also searched on just RemovePlayerWeapon without stock?
Using stock in your gamemode other than in includes is just bad programming.
A lot of people don't seem to know what stock does/mean in samp so take a look here for more information about stock functions: https://forum.sa-mp.com/showthread.php?t=570635
Even though this post I am posting is notusefull for this topic. Amen!
__________________
Do not click on this URL -It is secret information
RIP Slayer 1981-2019 \m/
Kwarde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling ERROR Polt Scripting Help 3 16/06/2018 12:42 PM
Getting some error while compiling ?? Laure Scripting Help 10 11/04/2014 11:18 AM
Compiling error atomic gaming Scripting Help 4 30/08/2012 07:22 AM
Compiling Error xSiiLenTx Server Support 2 15/08/2012 10:56 PM
Compiling error: (3159) : error 025: function heading differs from prototype Joeyboy99 Scripting Help 2 10/08/2012 07:23 PM


All times are GMT. The time now is 06:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.