SA-MP Forums Archive
shop robbery - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: shop robbery (/showthread.php?tid=261005)



shop robbery - stix - 11.06.2011

ok i make this script

its supposed to make u rob a store, then it freezes you and teleports you through the store making certain anims, like if you're robbing items

pawn Код:
forward rob1();
public rob1()
{
    new i;
    new string[128];
    new PlayerName[24];
    for(i = 0; i < MAX_PLAYERS; i++)
    GetPlayerName(i, PlayerName, sizeof(PlayerName));
    SetPlayerPos(i,-14.9267,-85.2380,1003.5469);
    format(string, sizeof string, "%s counts the money, then runs to a corner, and starts grabbing items.", PlayerName);
    SendClientMessageToAll(DARKBLUE,string);
    SetTimer("rob2", 5000, false); // Set a timer of 1000 miliseconds (1 second)
    TogglePlayerControllable(i,0);
}

forward rob2();

public rob2()
{
    new i;
    new string[128];
    new PlayerName[24];
    for(i = 0; i < MAX_PLAYERS; i++)
    GetPlayerName(i, PlayerName, sizeof(PlayerName));
    SetPlayerPos(i,-17.2405,-76.9187,1003.5542);
    format(string, sizeof string, "%s puts the items in a corner, then runs to the other corner, grabbing items.", PlayerName);
    SendClientMessageToAll(DARKBLUE,string);
    SetTimer("rob3", 5000, false); // Set a timer of 1000 miliseconds (1 second)
    TogglePlayerControllable(i,0);
}

forward rob3();

public rob3()
{
    new i;
    new string[128];
    new PlayerName[24];
    for(i = 0; i < MAX_PLAYERS; i++)
    GetPlayerName(i, PlayerName, sizeof(PlayerName));
    SetPlayerPos(i,-24.9213,-74.3248,1003.5469);
    format(string, sizeof string, "%s rapidly moves to another side of the store, and takes the items as fast as he cans.", PlayerName);
    SendClientMessageToAll(DARKBLUE,string);
    SetTimer("rob4", 5000, false); // Set a timer of 1000 miliseconds (1 second)
    TogglePlayerControllable(i,0);
    GivePlayerMoney(i,800);
}

forward rob4();

public rob4()
{
    new i;
    new string[128];
    new PlayerName[24];
    for(i = 0; i < MAX_PLAYERS; i++)
    GetPlayerName(i, PlayerName, sizeof(PlayerName));
    SetPlayerPos(i,-35.8847,-83.6388,1003.5469);
    format(string, sizeof string, "%s grabs all the taken items into a bag, then ties it and runs away from the store.", PlayerName);
    SendClientMessageToAll(DARKBLUE,string);
    TogglePlayerControllable(i,1);
    TogglePlayerControllable(i,1);
    PlayerData[i][illegaljob] = 1;
    SetTimer("illegaltime",7200000000, false); // 2 hours
}
Then the problem is that it doesn't after he started the robbery, and it also doesn't unfreezes him at final, which is rob4 timer.


Re: shop robbery - stix - 11.06.2011

sorry for double posting but i need some help lol