[HELP] Error with my Pickup
#1

top of my script

pawn Код:
new cash;
Into GameModeInit

pawn Код:
cash = CreatePickup( 1242, 23, 135.6321,1875.8905,22.4375 );
PlayerPickup

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == cash)
  {
    GivePlayerMoney(playerid,10000);
   
  }
)
Where is the error?
Reply
#2

What's wrong ? You don't get $ ? It's not there ?
Reply
#3

C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(42) : error 017: undefined symbol "cash"
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(183) : error 017: undefined symbol "cash"
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(18 : warning 217: loose indentation
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(18 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(188 -- 190) : warning 215: expression has no effect
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(190) : error 001: expected token: ";", but found "public"
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(190) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(190) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#4

You missed an ';' at 189 or so.
Reply
#5

You missed a return 1; at the end of the code
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == cash)
  {
    GivePlayerMoney(playerid,10000);
  return 1;
  }
)
Reply
#6

now i got

C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(42) : error 017: undefined symbol "cash"
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(183) : error 017: undefined symbol "cash"
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(18 : warning 217: loose indentation
C:\Documents and Settings\Daniel\Desktop\SAMP SERVER\gamemodes\test.pwn(18 : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#7

Show us your line 42, 183, 188, and the lines before and after them.
Reply
#8

42.
Код:
public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("The Server ");

  cash = CreatePickup( 1242, 23, 135.6321,1875.8905,22.4375 );
	
	AddPlayerClass(0, 222.8197,1869.8074,13.1406,88.1455, 4,1, 22, 150, 0, 0);
	AddPlayerClass(1, 222.8197,1869.8074,13.1406,88.1455, 4,1, 28, 150, 0, 0);
	AddPlayerClass(41, 222.8197,1869.8074,13.1406,88.1455, 4,1, 22, 150, 0, 0);
	AddPlayerClass(12, 222.8197,1869.8074,13.1406,88.1455, 4,1, 28, 150, 0, 0);
	return 1;
}
183 And 188

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == cash)
  {
    GivePlayerMoney(playerid,10000);
   
  }
)
}

Reply
#9

make sure that new cash; is at the top of your script and not in a public

also you have a ")" under OnPlayerPickupPickup
Reply
#10

i know that!
Quote:
Originally Posted by Smiths
top of my script

pawn Код:
new cash;
Into GameModeInit

pawn Код:
cash = CreatePickup( 1242, 23, 135.6321,1875.8905,22.4375 );
PlayerPickup

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == cash)
  {
    GivePlayerMoney(playerid,10000);
   
  }
)
Where is the error?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)