Weapon pickups
#1

Hi, sorry to keep posting stuff, i am trying to get my server fixed my tomorrow :P
so. I have weapon spawns but i get errors with this code

Код:
#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_BLUE 0x95DFECFF
#define COLOR_DIS_RED 0xFF0000FF
#define COLOR_CON_GREEN 0x00FF00FF
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SPAWN 0xFF8C55FF
#define COLOR_LIGHTBLUE 0x6DC5F3FF
#define COLOR_ADMIN 0xFF0000FF
#define COLOR_SAY 0x2986CEFF
#define COLOR_SYSGREY 0xC6BEBDFF
#define COLOR_BLACK 0x000000FF
#define COLOR_JOIN 0x74E80099
#define COLOR_WARN 0xBE615099
#define COLOR_RACE 0x00BBBB99
#define COLOR_KRED 0xFF0000FF
#if defined FILTERSCRIPT



public OnFilterScriptInit()
{
UsePlayerPedAnims();
    
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{

 }
#endif

public OnGameModeInit()
{
	UsePlayerPedAnims();
	Sniper_Rifle = CreatePickup(358, 2, 267.8414,1411.7373,10.4771);
	Shotgun = CreatePickup(351, 2, 267.4356,1413.4476,10.4709);
	Flame = CreatePickup(361, 2, 267.1187,1415.1340,10.4721);

}
public OnPlayerCommandText(playerid,cmdtext[])
{
//DMFACTORY---------------------------------------------------------------------
	if( !strcmp(cmdtext,"/deathmatch",true ))
    {
    SetPlayerPos(playerid,262.5633,1413.5773,10.4977);
    SetPlayerWorldBounds(playerid, 315.3026, 81.74512, 1518.124, 1331.278);
    SendClientMessage(playerid, COLOR_GREY, "Welcome To The Deathmatch, TO EXIT TYPE /exit !otherwise you will not leave :P");
    GameTextForPlayer(playerid,"Death Match TO LEAVE TYPE /EXIT otherwise you will not leave :P",6000,5);
    ResetPlayerWeapons(playerid);
    SetPlayerArmour(playerid,100);
    SetPlayerHealth(playerid,100);
    return 1;
          }
//DMSEAEND----------------------------------------------------------------------
    else if (strcmp(cmdtext, "/exit", true)==0)
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000);
    ResetPlayerWeapons(playerid);
    SetPlayerArmour(playerid,0);
    SetPlayerHealth(playerid,100);
    SetPlayerPos(playerid,405.2699,2531.5386,16.5633);

    return 1;
  }
  return 0;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == Sniper_Rifle)
  {
		GivePlayerWeapon(playerid, 34, 1000);
  }
  if(pickupid == Shotgun)
  {
		GivePlayerWeapon(playerid, 26, 1000);
  }
  if(pickupid == flame)
  {
		GivePlayerWeapon(playerid, 37, 9999);
  }
  return 1;
}
The errors are:
Код:
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(51) : error 017: undefined symbol "Sniper_Rifle"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(52) : error 017: undefined symbol "Shotgun"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(53) : error 017: undefined symbol "Flame"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(87) : error 017: undefined symbol "Sniper_Rifle"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(91) : error 017: undefined symbol "Shotgun"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(95) : error 017: undefined symbol "flame"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#2

You have to change "snipers" and weapons to

Weapon ids.
Reply
#3

i dont know what you mean, please could you show me? Thanks
Reply
#4

in the beginning of your script (out of all the callbacks)

pawn Код:
new Sniper_Rifle;
new Shotgun;
new Flame;
new Sniper_Rifle;
new Shotgun;
new flame;
That should fix it

Also, harly is wrong.
Reply
#5

3 errors

C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(6) : error 021: symbol already defined: "Sniper_Rifle"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(7) : error 021: symbol already defined: "Shotgun"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(9 : error 017: undefined symbol "Sniper_rifle"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(5 : warning 204: symbol is assigned a value that is never used: "Sniper_Rifle"
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(58 -- 10 : warning 203: symbol is never used: "flame"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#6

https://sampwiki.blast.hk/wiki/PickupGuide
Reply
#7

flame is not the same as Flame.
Reply
#8

Quote:
Originally Posted by Zoopaman
in the beginning of your script (out of all the callbacks)

pawn Код:
new Sniper_Rifle;
new Shotgun;
new Flame;
new Sniper_Rifle;
new Shotgun;
new flame;
That should fix it

Also, harly is wrong.
pawn Код:
new Sniper_Rifle;
new Shotgun;
new Flame;
Quote:
Originally Posted by CAMERON_BANFIELD
C:\Documents and Settings\Cameron Banfield\Desktop\DM.pwn(9 : error 017: undefined symbol "Sniper_rifle"
You have one variable in the wrong name, you capitalize Rifle and in one line you don't, capitalized letters are case sensitive.

pawn Код:
#include <a_samp>

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_BLUE 0x95DFECFF
#define COLOR_DIS_RED 0xFF0000FF
#define COLOR_CON_GREEN 0x00FF00FF
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SPAWN 0xFF8C55FF
#define COLOR_LIGHTBLUE 0x6DC5F3FF
#define COLOR_ADMIN 0xFF0000FF
#define COLOR_SAY 0x2986CEFF
#define COLOR_SYSGREY 0xC6BEBDFF
#define COLOR_BLACK 0x000000FF
#define COLOR_JOIN 0x74E80099
#define COLOR_WARN 0xBE615099
#define COLOR_RACE 0x00BBBB99
#define COLOR_KRED 0xFF0000FF
#if defined FILTERSCRIPT


new Sniper_Rifle;
new Shotgun;
new Flame;

public OnFilterScriptInit()
{
UsePlayerPedAnims();
   
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{

 }
#endif

public OnGameModeInit()
{
    UsePlayerPedAnims();
    Sniper_Rifle = CreatePickup(358, 2, 267.8414,1411.7373,10.4771);
    Shotgun = CreatePickup(351, 2, 267.4356,1413.4476,10.4709);
    Flame = CreatePickup(361, 2, 267.1187,1415.1340,10.4721);

}
public OnPlayerCommandText(playerid,cmdtext[])
{
//DMFACTORY---------------------------------------------------------------------
    if( !strcmp(cmdtext,"/deathmatch",true ))
    {
    SetPlayerPos(playerid,262.5633,1413.5773,10.4977);
    SetPlayerWorldBounds(playerid, 315.3026, 81.74512, 1518.124, 1331.278);
    SendClientMessage(playerid, COLOR_GREY, "Welcome To The Deathmatch, TO EXIT TYPE /exit !otherwise you will not leave :P");
    GameTextForPlayer(playerid,"Death Match TO LEAVE TYPE /EXIT otherwise you will not leave :P",6000,5);
    ResetPlayerWeapons(playerid);
    SetPlayerArmour(playerid,100);
    SetPlayerHealth(playerid,100);
    return 1;
          }
//DMSEAEND----------------------------------------------------------------------
    else if (strcmp(cmdtext, "/exit", true)==0)
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000);
    ResetPlayerWeapons(playerid);
    SetPlayerArmour(playerid,0);
    SetPlayerHealth(playerid,100);
    SetPlayerPos(playerid,405.2699,2531.5386,16.5633);

    return 1;
  }
  return 0;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == Sniper_Rifle)
  {
        GivePlayerWeapon(playerid, 34, 1000);
  }
  if(pickupid == Shotgun)
  {
        GivePlayerWeapon(playerid, 26, 1000);
  }
  if(pickupid == Flame)
  {
        GivePlayerWeapon(playerid, 37, 9999);
  }
  return 1;
}
Reply
#9

Thanks :P
Reply


Forum Jump:


Users browsing this thread: