CMD rob store not working!
#1

So it even doesnt show the message ... I dont know whay!
So here is my cmd:

pawn Код:
CMD:robstore(playerid, params[])
{
    if(PlayerToPoint(3, playerid, -28.4819,-89.3805,1003.5469))
    {
        if(StoreRobed[playerid] == 0)
        {
            SendClientMessageToAll(Red,"The 24/7 is being robbed, go check it out!");
            SendClientMessage(playerid, Yellow,"You have started to rob the store, Cops have been noted");
            SendClientMessage(playerid, Red,"Stay in the store for 3 mins so you can claim the cash!");
            Robber[playerid] = 1;
            StoreRobed[playerid] =1;
            SetTimer("RobStore1",5,0);
            return 1;
        }
        else if(StoreRobed[playerid] == 1)
        {
            SendClientMessage(playerid, Red,"You already robed the store you need to wait!!");
        }
    }
    return 1;
}
Reply
#2

What message is not showing?
Reply
#3

Just write cmd where you want it doesn't work at all .. okay my bad writed it wrongly
Reply
#4

Show us the stock code for
pawn Код:
if(PlayerToPoint(3, playerid, -28.4819,-89.3805,1003.5469))
    {
Reply
#5

pawn Код:
public StoreRob1()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(Robber[i] == 1)
    {
        if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
        {
            SendClientMessage(i, Yellow," 1 min has gone");
            SetTimer("StoreRob2",60000,0);
            return 1;

        }
        else
        {
            SendClientMessage(i, Grey,"You ran like a little girl");
            Robber[i] = 0;
            return 1;
        }
    }
    return 1;
}
public StoreRob2()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(Robber[i] == 1)
    {
    if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
    {
        SendClientMessage(i, Yellow,"  2 min has gone");
        SetTimer("StoreRob3",5,0);
        return 1;

    }
    else
    {
        SendClientMessage(i, Grey,"You ran like a little girl");
        Robber[i] = 0;
        return 1;
        }

    }return 1;
}
public StoreRob3()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(Robber[i] == 1)
    {
    if(PlayerToPoint(30, i, -28.4819,-89.3805,1003.5469))
    {
        SendClientMessage(i, Yellow," You have Robbed the Store, well done, you get $182");
        GivePlayerMoney(i,182);
        Robber[i] = 0;
        return 1;
    }
    else
    {
        SendClientMessage(i, Grey,"You ran like a little girl");
        Robber[i] = 0;
        return 1;
        }

    }return 1;
}
Reply
#6

Stop editing gamemodes, they are full of shitty code and bugs;
Use IsPlayerInRangeOfPoint instead;
Remove the return 1; after launching the timer;
Reply
#7

Btw it ain't an edit but okay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)