SA-MP Forums Archive
/robbank command - 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: /robbank command (/showthread.php?tid=365241)



/robbank command - Armando B - 02.08.2012

i cant seem to get this to work?

Код:
if(strcmp(cmdtext, "/robbank", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
        if(robbing[playerid] == 1)
        {
            SendClientMessage(Playerid, 0xAFAFAFAA, "You Are Already Robbing The Bank!");
            return 1;
        }
        if(alreadyrobbed[playerid] == 1)
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "You Already Robbed The Bank Lately, Please Wait 1 Hour!");
            return 1;
        }
        if(!IsPlayerInRangeOfPoint(playerid, 15.0, 2394.35,-1593.94,785.62))//CHANGE X Y Z!!!
        {
            SendClientMessage(playerid, 0xAFAFAFAA, "You Are Not At The Bank!");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, 0xFFFF00AA "You Have Robbed The Los Santos Local Bank And Stole $500,000!");
            robbing[playerid] = 1;
            LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, 0);
            GivePlayerMoney(playerid, 1000000);
            SendClientMessageToAll(0xFF9900AA, "||----------Breaking News----------||");
            SendClientMessageToAll(0x33CCFFAA, " The Los Santos Bank Has Been Robbed!");
            SendClientMessageToAll(0x33CCFFAA, " We Advise Everyone To Stay Away From The Area");
            SendClientMessageToAll(0x33CCFFAA, " Untill Further Notice.");
            SendClientMessageToAll(0xFF9900AA, "||----------Breaking News----------||");
        }
    }
    return 1;
}
any help?


Re: /robbank command - McCurdy - 02.08.2012

any error or warning?


Re: /robbank command - Armando B - 02.08.2012

sorry

Код:
C:\Documents and Settings\Owner\Desktop\test.pwn(95) : error 017: undefined symbol "robbing"
C:\Documents and Settings\Owner\Desktop\test.pwn(95) : warning 215: expression has no effect
C:\Documents and Settings\Owner\Desktop\test.pwn(95) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Owner\Desktop\test.pwn(95) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\test.pwn(95) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: /robbank command - [MM]RoXoR[FS] - 02.08.2012

Add this to top

Код:
new robbing[MAX_PLAYERS];



Re: /robbank command - Armando B - 02.08.2012

Код:
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(214) : warning 217: loose indentation
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(220) : error 017: undefined symbol "Playerid"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(223) : error 017: undefined symbol "alreadyrobbed"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(223) : warning 215: expression has no effect
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(223) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(223) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(223) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: /robbank command - oKzrh - 02.08.2012

Add this to the top of your mode: (Under defines, includes, etc.. Where more variables should be)
pawn Код:
new alreadyrobbed[MAX_PLAYERS];
Change the command to this:
pawn Код:
if(strcmp(cmdtext, "/robbank", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(robbing[playerid] == 1) return SendClientMessage(playerid, 0xAFAFAFAA, "You Are Already Robbing The Bank!");
        if(alreadyrobbed[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFAA, "You Already Robbed The Bank Lately, Please Wait 1 Hour!");
        if(!IsPlayerInRangeOfPoint(playerid, 15.0, 2394.35,-1593.94,785.62)) return SendClientMessage(playerid, 0xAFAFAFAA, "You Are Not At The Bank!");
       
        SendClientMessage(playerid, 0xFFFF00AA "You Have Robbed The Los Santos Local Bank And Stole $500,000!");
        robbing[playerid] = 1;
        LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, 0);
        GivePlayerMoney(playerid, 1000000);
        SendClientMessageToAll(0xFF9900AA, "||----------Breaking News----------||");
        SendClientMessageToAll(0x33CCFFAA, " The Los Santos Bank Has Been Robbed!");
        SendClientMessageToAll(0x33CCFFAA, " We Advise Everyone To Stay Away From The Area");
        SendClientMessageToAll(0x33CCFFAA, " Untill Further Notice.");
        SendClientMessageToAll(0xFF9900AA, "||----------Breaking News----------||");
    }
    return 1;
}
In OnPlayerConnect, add this:
pawn Код:
robbing[playerid] = false;
alreadyrobbed[playerid] = false;