Help With Treasures Please
#1

how can I make it harmless against, first found?
Код:
  if(!strcmp("/find",cmdtext))
  {
  if(IsPlayerInRangeOfPoint(playerid, 25.0, 2695.6880, -1704.6300, 11.8438))
  SendClientMessage(playerid,0xFFFFFFFF,"You Found Full Suitcase Of Money!");
  GivePlayerMoney(playerid ,50000);
  return 1;
  }
Reply
#2

is there anyway to make it harmless of first use?
Reply
#3

You may have to write a variable as a pickup and the destroy pickup.

new treasure1;

under gamemodeinit

treasure1 = createpickup(xxxx,2695.6880, -1704.6300, 11.843;
undercommandtextsection

if(!strcmp("/find",cmdtext))
if(pickupid == treasure1)

SendClientMessage(playerid,0xFFFFFFFF,"You Found Full Suitcase Of Money!");
GivePlayerMoney(playerid ,50000);
DestroyPickup(treasure1);
return 1;
}
return 0;


xxxx is the modelid you would want to use, for instance 1210 is a briefcase with circle.

This may not compile correct, I have not tested it, but, give me about 30 minutes to get to my programming station and I will have something more promising for you.
Reply
#4

above is revised, I added destroy pickup
Reply
#5

i tryd to resolve now i got 2 errors
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(140) : warning 213: tag mismatch
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(140) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(700) : error 017: undefined symbol "pickupid"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(703) : error 017: undefined symbol "treasure1"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(140) : warning 204: symbol is assigned a value that is never used: "Treasure1"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(140 -- 1058) : warning 203: symbol is never used: "fishNames"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

ok now i got 1 error only

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(140) : warning 213: tag mismatch
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(140) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(700) : error 017: undefined symbol "Pickupid"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\kfs.pwn(1058) : warning 203: symbol is never used: "fishNames"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

I got it and it compiled just fine.

Here you go.

new treasure1;

public OnGameModeInit()


{
treasure1 = CreatePickup(1210,19,2695.6880, -1704.6300, 11.843;
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{


/*****This section is used to help a person on the forums****/

if((strcmp(cmdtext, "/find", true) == 0))

{
SendClientMessage(playerid,0xFFFFFFFF,"You Found Full Suitcase Of Money!");
GivePlayerMoney(playerid ,50000);


DestroyPickup(treasure1);
return 1;
}
/*****end of section*****/
return 0;
}


I also added this to mine and it works too. This is OnPlayerPickupPickup in case your interested.

public OnPlayerPickUpPickup(playerid, pickupid)

if(pickupid == treasure1)

{
SendClientMessage(playerid,0xFFFFFFFF,"You Found Full Suitcase Of Money!");
GivePlayerMoney(playerid ,50000);


DestroyPickup(treasure1);
return 1;
}
return 0;
}


Everything compiles perfect for me. Let me know it this works for you.
Reply
#8

thank you very much now errors anymore
Reply
#9

I am glad to hear it, make sure that when you are in your server, test it out and make sure it works. Sometimes, even if the code compiles correctly, it may not show up in the server. I am having the same problem with a vehicle script I am making. So make sure you test it. Also, another thing. I made you treasure a variable of treasure1 that way if you want to do the same thing again but add different treasures and locations, you can. Just make new treasure2; and so on. Then just change the coordinates under createpickup and add replace the variable...Good Luck. I hope everything works out. BTW, I may come on your server that you have posted in your sig bar. Have fun.
Reply
#10

btw i tested it and when im typing /find anywhere then i got 50000$ everywhere.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)