Help...
#1

Hello,
i've got a little problem right here...
pawn Code:
if (strcmp("/buy", cmdtext, true, 10) == 0){
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 368.6851,-1279.7899,13.5469))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You Are Not Near Ammu-Nation Entrance!");
        ShowPlayerDialog(playerid, 3,DIALOG_STYLE_LIST, "{F81414}Ammu-Nation!","1.Ak47 {4500$} \n2.M4 {4800$} \n3.Deagle {1600$} \n4. SawnOff {2700$} \n5.Silenced Pistol {1950$}.","Okay","Cancel");
    }
    return 1;
    }
This looks cool, but IsPlayerInRangeOfPoint Is not Working, And players can type /Buy anywhere...
Any kind of help in this will be appreciated muchly.
Thankx.
Reply
#2

pawn Code:
if (strcmp("/buy", cmdtext, true, 4) == 0){
  if(IsPlayerInRangeOfPoint(playerid, 2.0, 368.6851,-1279.7899,13.5469))
    {
    ShowPlayerDialog(playerid, 3,DIALOG_STYLE_LIST, "{F81414}Ammu-Nation!","1.Ak47 {4500$} \n2.M4 {4800$} \n3.Deagle {1600$} \n4. SawnOff {2700$} \n5.Silenced Pistol {1950$}.","Okay","Cancel");
    }
    else
    {
    SendClientMessage(playerid,0xFFFFFFFF,"You Are Not Near Ammu-Nation Entrance!");
    }
    return 1;
    }
Reply
#3

pawn Code:
if(strcmp("/buy", cmdtext, true, 4) == 0) { // 4 Chars, not 10.
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 368.6851,-1279.7899,13.5469))return SendClientMessage(playerid,0xFFFFFFFF,"You Are Not Near Ammu-Nation Entrance!");
    else return ShowPlayerDialog(playerid, 3,DIALOG_STYLE_LIST, "{F81414}Ammu-Nation!","1.Ak47 {4500$} \n2.M4 {4800$} \n3.Deagle {1600$} \n4. SawnOff {2700$} \n5.Silenced Pistol {1950$}.","Okay","Cancel");
}
Reply
#4

Thankx.
Reply
#5

Hello,
Another Problem Here.....
pawn Code:
{
if(pickupid == Mypickup)
{
SendClientMessage(playerid,COLOR_RED,"You Are At Ammu-nation, Type /buy");
}
return 1;
}
When player reaches at tha pickup it dosent show anything :\
pawn Code:
Mypickup = CreatePickup(1318,2,1368.6851,-1279.7899,13.5469,0);
Reply
#6

pawn Code:
{
if(pickupid == Mypickup)
{
SendClientMessage(playerid,COLOR_RED,"You Are At Ammu-nation, Type /buy");
}
return 1;
}
Is this code placed under OnPlayerPickupPickup?
Reply
#7

Yes.
Reply
#8

pawn Code:
forward OnPlayerPickupPickup(pickupid,playerid);
public OnPlayerPickupPickup(pickupid,playerid)
{
if(pickupid == Mypickup)
{
SendClientMessage(playerid,COLOR_RED,"You Are At Ammu-nation, Type /buy");
}
return 1;
}
looks like this.
Reply
#9

Alright, the declaration of Mypickup variable is placed under OnGameModeInit callback, right?
Reply
#10

Yes.....
As i said, everything is right in the way it was supposed to be, but still problems are occurin'
Reply
#11

Rename the OnPlayerPickupPickup(pickupid,playerid) to OnPlayerPickUpPickup(playerid,pickupid) and remove the forward at the beginning. Should work then.
Reply
#12

Oh thankx, it works now.
+rep
Reply
#13

No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)