Menu Upon Entering Checkpoint
#1

I've managed to create a working menu to buy items at the 24/7 convenience store. Unfortunately, the only way I can activate this menu is by using the "/command" that I bound it to. What I am ultimately trying to do is when you enter the checkpoint in the store, the menu that I have created will come up. If anyone could help me out, I'd really appreciate it, I couldn't find anything after scouring these forums and the SA:MP wiki resource posted for beginner scripters. Please let me know if you need me to post any code or anything, thanks again.
Reply
#2

Maybe to try using pickup not checkpoint and then
OnPlayerPickupPickup
Reply
#3

But pickup is more nice then checkpoint!
Reply
#4

Ok, kind of got confused on that last bit, sorry.

So in order to use the pickup I did the following, but received 26 errors when compiling, sorry to be a pain, but could someone explain what I did wrong?

Код:
new store;
 
public OnGameModeInit()
{
  store = CreatePickup(266,-23.1450,-55.2841,1003.5469,95.0858);
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if (pickupid == store)
  {
    ShowMenuForPlayer(storemenu,playerid);
  }
}
Reply
#5

Yeah,working?
Reply
#6

Quote:
Originally Posted by Rhemsis
store = CreatePickup(266,-23.1450,-55.2841,1003.5469,95.085;
CreatePickup(model, type, Float:X, Float:Y, Float:Z);

You can't use float number for type.
Reply
#7

Ok, I changed the type number to 2 (it was what they had on the SA:MP Wiki in the example), But I still return 26 errors, two of which are on the lines of the newly posted code they are below.
Код:
1.8.2.pwn(1524) : warning 209: function "OnPlayerPickUpPickup" should return a value
1.8.2.pwn(1525) : error 055: start of function body without function header
Reply
#8

Quote:
Originally Posted by pawn-lang.pdf
Error 055: Start of function body without function header:
An opening brace (“{”) was found outside the scope of a function.
This may be caused by a semicolon at the end of a preceding
function header.
Reply
#9

Thanks, that helped fix that error, but as soon as I got rid of the { in question, this error popped up, however it is my only error when I try to compile.

Код:
1.8.2.pwn(20866) : error 021: symbol already defined: "OnPlayerPickUpPickup"
Here are my lines 20865-20872

Код:
20865   public OnPlayerPickUpPickup(playerid, pickupid)
20866   {
20867     if(pickupid >= 6 && pickupid <= 12 && GetPlayerWantedLevel(playerid) >=1 && GetPlayerWantedLevel(playerid) <=9 && GotCopBriberecently[playerid] == 0) {
20868     SendClientMessage(playerid, 0xA9A9A9AA, "|_LVPD Bribe Found - Wanted Level Reduced_|");
20869     SendClientMessage(playerid,0x00C7FFAA,"Your wanted level has been reduced");
20870     SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
20871     GotCopBriberecently[playerid] =250;
20872     }
Reply
#10

Use this:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid >= 6 && pickupid <= 12 && GetPlayerWantedLevel(playerid) >=1 && GetPlayerWantedLevel(playerid) <=9 && GotCopBriberecently[playerid] == 0)
{
SendClientMessage(playerid, 0xA9A9A9AA, "|_LVPD Bribe Found - Wanted Level Reduced_|");
SendClientMessage(playerid, 0x00C7FFAA, "Your wanted level has been reduced");
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 1);
GotCopBriberecently[playerid] =250;
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)