/robbank command
#1

i did this but i get 4 errors

Код:
          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;
   }
errors:
Код:
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(178) : warning 217: loose indentation
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : error 017: undefined symbol "robbing"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : warning 215: expression has no effect
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : 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
#2

Do you have: new robbing[MAX_PLAYERS]; at the top of your script?
If you took this command from an other gamemode/filterscript, you should define your global variables.

EDIT: There is something that made me laught a lot, it says you stole 500.000$ from the bank but it gives you 1 million.
Reply
#3

yeah, i just fixed that bit
Reply
#4

i added it but i still get the errors?
Reply
#5

Try
pawn Код:
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;
}
Reply
#6

i try to copy and paste and it comes out in one line?
Reply
#7

Quote:
Originally Posted by Armando B
Посмотреть сообщение
i try to copy and paste and it comes out in one line?
Use ****** chrome.
Reply
#8

same 4 errors

Код:
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(178) : warning 217: loose indentation
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : error 017: undefined symbol "robbing"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : warning 215: expression has no effect
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\Samp Stuff 2\my scripting\The Server\gamemodes\LS_DM.pwn(182) : 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


Forum Jump:


Users browsing this thread: 2 Guest(s)