What's wrong here?
#1

I made my robbery system (SF shopss) and this is the countdown but i have a problem:

pawn Код:
public CountDown(playerid)
{
  new string[128];
  format(string, sizeof(string), " Stay in the marker for %d seconds to complete the robbery", countn);
  GameTextForPlayer(playerid,string,10000,4);
  countn--;
  if(countn <= -1)
  {
    KillTimer(counttimer);
    GivePlayerMoney(playerid,2000);
    SetPlayerWantedLevel(playerid,4);
    new Float:x,Float:y,Float:z;
    new pos=GetPlayerPos(playerid,x,y,z);
    if(pos == wsp) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Well Stacked Pizza shop");
    if(pos == wsp2) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Well Stacked Pizza shop 2");
    if(pos == clb) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Cluckin' Bell shop");
    if(pos == clb2) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Cluckin' Bell shop 2");
    if(pos == bgs) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Burger Shot shop");
    if(pos == bgs2) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Burger Shot shop 2");
    if(pos == rcs) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from RC shop");
    if(pos == hts) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Hemlock Tatoo shop");
    if(pos == zip) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from ZIP shop");
    if(pos == gyd) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Gayadaa Disco");
    if(pos == sbu) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Suburban shop");
    if(pos == brb) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Barber Shop");
  }
  return 1;
}
When it gets to Stay in the marker for 1 seconds to complete the robbery,the server restarts,what's wrong?(maybe with the position is something worng)
Reply
#2

getplayerpos won't return a checkpointid it'll store the x y z co-ords into the floats you pass through it.
Reply
#3

I'm not sure but you better try doing it this way;
pawn Код:
public CountDown(playerid)
{
  new string[128];
  format(string, sizeof(string), " Stay in the marker for %d seconds to complete the robbery", countn);
  GameTextForPlayer(playerid,string,10000,4);
  countn--;
  if(countn <= -1)
  {
    KillTimer(counttimer);
    GivePlayerMoney(playerid,2000);
    SetPlayerWantedLevel(playerid,4);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Well Stacked Pizza shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Well Stacked Pizza shop 2");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Cluckin' Bell shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Cluckin' Bell shop 2");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Burger Shot shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Burger Shot shop 2");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from RC shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Hemlock Tatoo shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from ZIP shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Gayadaa Disco");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Suburban shop");
    if(x == x && y == y && z == z) return SendClientMessageToAll(COLOR_GREY,"%s has robbed 2000$ from Barber Shop");
  }
  return 1;
}
Now, change the second x, y, z to their places' coords and have a test.
Reply
#4

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
Now, change the second x, y, z to their places' coords and have a test.
then they'd have to be in that exact spot for it to work, I'd use checkpoints or range of points
Reply
#5

True, I forgot about that... he needs to use IsPlayerInRangeOfPoint then it'll work out, I guess.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)