06.05.2015, 14:39
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
and this /setuprobbery code:
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; }
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;