How do i suppose to do it?
#1

Aye people.

I got little prob

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
  if(
IsPlayerInCheckpoint(playerid))
  {
     if(
GetPlayerPos(playerid296.5538,-38.1188,1001.5156) return SendClientMessage(playerid, -1"You are not in the weaponshop.");
     
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Choose your weapon""Deagle\nShotgun\nSniper\nM4\nMP5\nCombat\nGrenade\nTec9""Purchase""Exit");
  }
  
SetPlayerPos(playerid286.9429,-37.3731,1001.5156);
  
SendClientMessage(playerid, -1"You have entered the weapon shop");
  return 
1;

How could i make if player types /weaponshop it will say him "You are not in the weapon shop"

P.S: If you need the cmd tell.
Reply
#2

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)
    return SendClientMessage(playerid, -1, "You are not in the weapon shop");
Reply
#3

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  if(IsPlayerInRangeOfPoint(playerid, 3, 296.5538,-38.1188,1001.5156))
  {
     ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper\nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
  }
  else SendClientMessage(playerid, -1, "You are not at the weapon shop!");
  SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156);
  SendClientMessage(playerid, -1, "You have entered the weapon shop");
  return 1;
}
Like this.
Reply
#4

Quote:
Originally Posted by Turn
Посмотреть сообщение
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  if(IsPlayerInRangeOfPoint(playerid, 3, 296.5538,-38.1188,1001.5156))
  {
     ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper\nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
  }
  else SendClientMessage(playerid, -1, "You are not at the weapon shop!");
  SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156);
  SendClientMessage(playerid, -1, "You have entered the weapon shop");
  return 1;
}
Like this.
Nope, that will still set his position and send him the "You have entered the weapon shop" message.



pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 296.5538,-38.1188,1001.5156))
    {
        SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156), SendClientMessage(playerid, -1, "You have entered the weapon shop");
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper\nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
    }
    return 1;
}
Reply
#5

Ain't workin, Compiles perfectly but when i use /weaponshop i can buy weapons.
Reply
#6

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Nope, that will still set his position and send him the "You have entered the weapon shop" message.



pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 296.5538,-38.1188,1001.5156))
    {
        SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156), SendClientMessage(playerid, -1, "You have entered the weapon shop");
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper\nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
    }
    return 1;
}
lol? it was his script I just fixed it for him why would I want to remove his messages?


Quote:
Originally Posted by Stuun
Посмотреть сообщение
Ain't workin, Compiles perfectly but when i use /weaponshop i can buy weapons.
? According to the script, you're not supposed to write any command but just enter a checkpoint that is located at 296.5538,-38.1188,1001.5156.
Reply
#7

Quote:
Originally Posted by Turn
Посмотреть сообщение
lol? it was his script I just fixed it for him why would I want to remove his messages?
nvm xd



Stuun, you can try doing,

pawn Код:
CMD:weaponshop(playerid, params[]) {
    OnPlayerEnterCheckpoint(playerid);
    return 1;
}
... but that wouldn't work on servers which have race checkpoints.

The only thing I can think of for you to do is remove the "IsPlayerInRangeOfPoint" at the "OnPlayerEnterCheckpoint" callback, and add it on the "weaponshop", ex:
pawn Код:
CMD:weaponshop(playerid, params[]) {
    if(IsPlayerInRangeOfPoint(playerid, 5, 296.5538,-38.1188,1001.5156))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper   \nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
        SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156), SendClientMessage(playerid, -1, "You have entered the weapon shop");
    }
    else SendClientMessage(playerid, -1, "You are not at the weapon shop!");
    return 1;
}
Reply
#8

Quote:
Originally Posted by Kyance
Посмотреть сообщение
nvm xd



Stuun, you can try doing,

pawn Код:
CMD:weaponshop(playerid, params[]) {
    OnPlayerEnterCheckpoint(playerid);
    return 1;
}
... but that wouldn't work on servers which have race checkpoints.

The only thing I can think of for you to do is remove the "IsPlayerInRangeOfPoint" at the "OnPlayerEnterCheckpoint" callback, and add it on the "weaponshop", ex:
pawn Код:
CMD:weaponshop(playerid, params[]) {
    if(IsPlayerInRangeOfPoint(playerid, 5, 296.5538,-38.1188,1001.5156))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper   \nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
        SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156), SendClientMessage(playerid, -1, "You have entered the weapon shop");
    }
    else SendClientMessage(playerid, -1, "You are not at the weapon shop!");
    return 1;
}
What the.... fuq is this?

pawn Код:
CMD:weaponshop(playerid, params[]) {
    OnPlayerEnterCheckpoint(playerid);
    return 1;
}
Calling a callback? The foq r u doin. Get your shit together m8.
He just wanted the command why are you doing the checkpoints and shit.

pawn Код:
CMD:weaponshop(playerid, params[])
        {
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)// your co-ordinates here m8
           return SendClientMessage(playerid, -1, "You are not in the weapon shop");
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your weapon", "Deagle\nShotgun\nSniper   \nM4\nMP5\nCombat\nGrenade\nTec9", "Purchase", "Exit");
        SetPlayerPos(playerid, 286.9429,-37.3731,1001.5156), SendClientMessage(playerid, -1, "You have entered the weapon shop");
    return 1;
}
Reply
#9

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Stuun, you can try doing,

pawn Код:
CMD:weaponshop(playerid, params[]) {
    OnPlayerEnterCheckpoint(playerid);
    return 1;
}
Now that makes as much sense as putting a woman and a mouse in the same room D
Reply
#10

You can use IsPlayerInCheckpoint, along with IsPlayerInRangeOfPoint. This is actually really easy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)