/robbank command
#1

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?
Reply
#2

any error or warning?
Reply
#3

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.
Reply
#4

Add this to top

Код:
new robbing[MAX_PLAYERS];
Reply
#5

Код:
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.
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)