Bank Robbery Help Rep+
#1

Hello, i Have bank robbery system now How I can make it when someone request to rob the bank send massage to admins like ''{AA3333}AdmWarning{FFFF00}: %s would like to set up a Bank Robbery - /acceptrob or /denyrob'', like cmd /vipparty
Code:
CMD:vipparty(playerid, params[])
{
    if( PlayerInfo[playerid][pDonateRank] == 5 )
	{
        new string[128+MAX_PLAYER_NAME];
        if( EventKernel[ EventStatus ] == 0 )
		{
            if(EventKernel[EventRequest] != INVALID_PLAYER_ID || EventKernel[EventCreator] != INVALID_PLAYER_ID)
			{
                SendClientMessageEx(playerid, COLOR_GRAD2, "There's already someone requesting/making an event.");
                return 1;
            }
            if(EventKernel[EventAdvisor] == 1)
			{
                SendClientMessageEx(playerid, COLOR_GRAD2, "Another admin/advisor already requested/made an event within the last three hours, please try again later!");
                return 1;
            }
            if(PlayerInfo[ playerid ][ pAdmin ] >= 4 || PlayerInfo[playerid][pDonateRank] == 5) {
                EventKernel[ EventRequest ] = playerid;
                SendClientMessageEx( playerid, COLOR_GRAD2, "You have requested to set up an event, please wait until a Senior Admin approves it." );
                format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: VIP Mod %s would like to set up a VIP event - /acceptevent or /denyevent", GetPlayerNameEx(playerid) );
                ABroadCast( COLOR_YELLOW, string, 4 );
                EventKernel[EventAdvisor] = 1;
                EventKernel[VipOnly] = 1;
                EventTimerHandle = SetTimer("ERequested", 9600000, false);
            }
        }
        else
		{
            SendClientMessageEx( playerid, COLOR_WHITE, "There is already an active event (use /endevent)." );
        }
    }
    return 1;
}

CMD:denyevent(playerid, params[])
{
    if( PlayerInfo[ playerid ][ pAdmin ] >= 4 ) {
        new string[128];
        SendClientMessageEx( EventKernel[EventRequest], COLOR_GRAD2, "Your request was denied." );
        EventKernel[EventRequest] = INVALID_PLAYER_ID;
        EventKernel[EventCreator] = INVALID_PLAYER_ID;
        format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s has denied the event request.", GetPlayerNameEx(playerid) );
        ABroadCast( COLOR_YELLOW, string, 4 );
        for(new i; i < sizeof(EventKernel[EventStaff]); i++) {
            if(EventKernel[EventStaff][i] != INVALID_PLAYER_ID) {
                SetPlayerWeapons(EventKernel[EventStaff][i]);
                SetPlayerPosEx(EventKernel[EventStaff][i],EventFloats[EventKernel[EventStaff][i]][1],EventFloats[EventKernel[EventStaff][i]][2],EventFloats[EventKernel[EventStaff][i]][3]);
                SetPlayerVirtualWorld(EventKernel[EventStaff][i], EventLastVW[EventKernel[EventStaff][i]]);
                SetPlayerFacingAngle(EventKernel[EventStaff][i], EventFloats[EventKernel[EventStaff][i]][0]);
                SetPlayerInterior(EventKernel[EventStaff][i],EventLastInt[EventKernel[EventStaff][i]]);
                SetPlayerHealth(EventKernel[EventStaff][i], EventFloats[EventKernel[EventStaff][i]][4]);
                SetPlayerArmour(EventKernel[EventStaff][i], EventFloats[EventKernel[EventStaff][i]][5]);
                for(new d = 0; d < 6; d++) {
                    EventFloats[EventKernel[EventStaff][i]][d] = 0.0;
                }
                EventLastVW[EventKernel[EventStaff][i]] = 0;
                EventLastInt[EventKernel[EventStaff][i]] = 0;
                EventKernel[EventStaff][i] = INVALID_PLAYER_ID;
                ResetPlayerWeapons( i );
            }
        }

        EventKernel[ EventStatus ] = 0;
        EventKernel[ EventType ] = 0;
        EventKernel[ EventLimit ] = 0;
        EventKernel[ EventPlayers ] = 0;
        EventKernel[ EventWeapons ][0] = 0;
        EventKernel[ EventWeapons ][1] = 0;
        EventKernel[ EventWeapons ][2] = 0;
        EventKernel[ EventWeapons ][3] = 0;
        EventKernel[ EventWeapons ][4] = 0;
        EventKernel[EventCreator] = INVALID_PLAYER_ID;
        EventKernel[VipOnly] = 0;
        EventKernel[EventJoinStaff] = 0;
    }

    return 1;
}

CMD:acceptevent(playerid, params[])
{
    if( PlayerInfo[ playerid ][ pAdmin ] >= 4 ) {
        if( EventKernel[ EventStatus ] == 0 ) {
            if(EventKernel[EventRequest] != INVALID_PLAYER_ID) {
                if(IsPlayerConnected(EventKernel[EventRequest])) {
                    if(EventKernel[EventCreator] != INVALID_PLAYER_ID) {
                        SendClientMessageEx(playerid, COLOR_GRAD2, "There's already someone making an event.");
                        return 1;
                    }
                    new string[128];
                    EventKernel[EventCreator] = EventKernel[EventRequest];
                    EventKernel[EventRequest] = INVALID_PLAYER_ID;
                    SetPVarInt( EventKernel[EventCreator], "EventToken", 1 );
                    SendClientMessageEx( EventKernel[EventCreator], COLOR_GRAD2, "Your event request has been accepted, use /seteventpos to change the event position, once you do it people will be able to /eventstaff." );
                    if(PlayerInfo[playerid][pHelper] >= 2) {
                        SendClientMessageEx( EventKernel[EventCreator], COLOR_GRAD2, "You now have temporary access to (/o)oc and /goto." );
                    }
                    format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s has approved the event request from %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(EventKernel[EventCreator]) );
                    ABroadCast( COLOR_YELLOW, string, 4 );
                    return 1;
                }
            }
        }
    }
    return 1;
}
and this /setuprobbery code:
Code:
CMD:setuprobbery(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] != 1 || PlayerInfo[playerid][pMember] != 2 || PlayerInfo[playerid][pMember] != 5 || PlayerInfo[playerid][pMember] != 7)
	{
		#pragma unused params
		if(IsPlayerConnected(playerid))
  		{
	    	    for(new i = 0; i < MAX_PLAYERS; i++)
    			{
    			    if(IsACop(i))
    			    {
    			        LEOOnline += 1;
    			    }
    			}
    			if(PlayerInfo[playerid][pLevel] < 5)
    			{
    			    SendClientMessage(playerid, COLOR_GREY, "You must be level 5 or higher to make a bank robbery!");
	 	        	return 1;
    			}
    			if(LEOOnline <= 4)
    			{
    			    SendClientMessage(playerid, COLOR_GREY, "There's not at least 4-5 LEOs on!");
	 	        	return 1;
    			}
	    		if(RobStatus[BankReload] >= 1)
	 	    	{
	       			SendClientMessage(playerid, COLOR_GREY, "Someone has robbed the bank recently!");
	 	        	return 1;
		 	    }
	 	    	if(RobStatus[BeingRobbed] == 1)
	   			{
		    		SendClientMessage(playerid, COLOR_GREY, "Someone is robbing the Bank!");
	       			return 1;
		 	    }
		 	    if(PlayerInfo[playerid][pLevel] <= 7)
		 	    {
		 	        SendClientMessage(playerid, COLOR_GREY, "You must be at least a Level 8+ to setup a robbery!");
	       			return 1;
		 	    }
	 	    	if(RobStatus[Setup] == 0)
		 	    {
	       			RobStatus[Setup] = 1;
	 	        	RobStatus[RobberID1] = playerid;
		 	        PlayerInfo[playerid][pRobbing] = 1;
		 	        SendClientMessage(playerid,COLOR_YELLOW, "** You've began setting up a robbery, get two more criminals to assist...");
		 	        SendClientMessage(playerid,COLOR_YELLOW, "** You can then blow the vault. Type /robbers to see the current team");
		 	    }
		 	    else
		 	    {
	       			SendClientMessage(playerid, COLOR_GREY, "Someone is already setting up a robbery!");
	 	        	return 1;
		 	    }
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_LIGHTRED, "You're a public official, you can't do that!");
 		return 1;
	}
	return 1;
Reply
#2

Save a string into a player variable.
Reply
#3

What??
Reply
#4

So basically, you want us to make you the whole system. If you do not know basics of PAWN, you should not script and hence hire a scripter. You can not expect us to make it, right? Only some people might help you if they are free. Good luck on that.
Reply
#5

Hello!

You want that the admins have to accept the robbery?
Reply
#6

Try this:

at the top of the script
PHP Code:
new prr[MAX_PLAYERS] = 1000//you will know why under
new accepted[MAX_PLAYERS] = 0
under the setup robbery command
PHP Code:
new string[128];
for(new 
0;MAX_PLAYERS;i++)
{
    if(
PlayerInfo[i][pAdmin] >= 4//as the other command
    
{
          
formatstringsizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s would like to set up a bank robbery - /acceptrobbery or /denyrobbery"GetPlayerNameEx(playerid) );
          
ABroadCastCOLOR_YELLOWstring);
          
prr[i] = playerid;
          
//reset of your code 
Under the accept command
PHP Code:
if(prr[playerid] != 1000//so the command won't run if there is no one requested a robbery
{
    
accepted[prr[playerid]] = 1;
    
SendClientMessage(prr[playerid],-1,"An admin accepted your bank robbery!");
    for(new 
0;MAX_PLAYERS;i++) 
    {
        
prr[i] = 1000//set the variable for a number above your slots number so if the play typed the command again it don't so the same with the player
    
}
//reset of your code
}
else
{
SendClientMessage(playerid,-1,"No one requested a robbery!");
}
return 
1
Under The deny one
PHP Code:
if(prr[playerid] != 1000)
{
    
accepted[prr[playerid]] = 2;
    
SendClientMessage(prr[playerid],-1,"An admin denid your bank robbery!");
    for(new 
0;MAX_PLAYERS;i++) 
    {
        
prr[i] = 1000//set the variable for a number above your slots number so if the play typed the command again it don't so the same with the player
    
}
//reset of your code
}
else
{
SendClientMessage(playerid,-1,"No one requested a robbery!");
}
return 
1
Reply
#7

Why you use a loop if you don't use the variable "i"?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)