SA-MP Forums Archive
CMD rob store not working! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD rob store not working! (/showthread.php?tid=427704)



CMD rob store not working! - Scrillex - 02.04.2013

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;
}



Re: CMD rob store not working! - Kestro - 02.04.2013

What message is not showing?


Re: CMD rob store not working! - Scrillex - 02.04.2013

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


Re: CMD rob store not working! - Kestro - 02.04.2013

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



Re: CMD rob store not working! - Scrillex - 02.04.2013

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;
}



Re: CMD rob store not working! - Hanger - 02.04.2013

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


Re: CMD rob store not working! - Scrillex - 02.04.2013

Btw it ain't an edit but okay