03.06.2012, 17:47
Hello there fellow members, I'm in need with some help on a Zcmd im stuck on, It is a bank robbery system, Here is my current code that i need help with.
I need help with "PlayerInfo[playerid][pRobTime] = 0;" line, i need it to set [pRobTime] in playerinfo for all players on the server, Anyone here able to help me out? Thanks in advanced.
Tyler.
Код:
//START: Reset Bank Robbery Command
CMD:resetbankk(playerid, params[])
{
if( PlayerInfo[ playerid ] [ pAdmin ] >= 99999 ) {
BankRobbedRecently = 0;
PlayerInfo[playerid][pRobTime] = 0;
new string[128];
format( string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has reset the bank robbery timer.", GetPlayerNameEx( playerid ) );
ABroadCast( COLOR_YELLOW, string, 4 );
}
else {
SendClientMessageEx( playerid, COLOR_GREY, "Command is not in your authority to be used!" );
}
return 1;
}
//END: Reset Bank Robbery Command
//START: Bank Robbery Command
forward UnsetBankRob();
public UnsetBankRob()
{
BankRobbedRecently = 0;
return 1;
}
CMD:robbank(playerid, params[])
{
new success = random(2);
if(BankRobbedRecently == 1)
{
SendClientMessage(playerid, COLOR_GREY, "* This location was robbed recently, try again later");
return 1;
}
if(PlayerInfo[playerid][pRobTime] >= 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.-jake is god");
return 1;
}
if(!IsAtRobBankPoint(playerid))
{
if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
{
if(PlayerInfo[playerid][pDuty] == 0)
{
if(success == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Los Santos bank, please remain in the checkpoint for 500 Seconds!");
RobbingTime[playerid] = 30;
WantedPoints[playerid] = 6;
SetPlayerCriminal(playerid,255, "Robbing the Bank");
PlayerInfo[playerid][pRobTime] = 86400;
BankRobbedRecently = 1;
GivePlayerCash(playerid, 400000);
SetTimer("UnsetBankRob",21600,false);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!");
WantedPoints[playerid] = 2;
SetPlayerCriminal(playerid,255, "Attempting to rob the Bank");
PlayerInfo[playerid][pRobTime] = 10;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Go Off duty first!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!");
return 1;
}
return 1;
}
//END: Bank Robbery Command
Tyler.

