Replacement help
#1

Oks so the old robbery system looks like this but i want to make it better
Note:This is only the gym

PHP код:
if(getCheckpointType(playerid) == CP_GYM)
    {
        if(
zones[current_zone][zone_name] == zones[116][zone_name] || zones[current_zone][zone_name] == zones[117][zone_name])
        {
            if(
GYMRobbedRecently >= 1)
            {
                
SendClientMessage(playerid,COLOR_GREY,"{FF0000}[ERROR]: {FFFFFF}The GYM has been robbed recently.");
                return 
1;
            }
            if(
rrand <= 30)
            {
                
SendClientMessage(playerid,COLOR_GREY,"{FF0000}GYM robbery failed.");
                
GYMRobbedRecently =320;
                return 
1;
            }
            
GYMRobbedRecently =320;
            
RobbingGYM[playerid] =25;
            
IncreaseWantedLevel(playerid,4);
            
IncreasePlayerScore(playerid,1);
            
format(string,sizeof(string),"{0000FF}Crime in Progesss: GYM Robbery - %s(%d) has Started to Rob GYM - Location: Garcia",PlayerName(playerid),playerid);
            
SendClientMessageToAllCops(string);
            
format(string,sizeof(string),"",PlayerName(playerid),playerid);
            
SendClientMessageToAll(COLOR_PURPLE,string);
            
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at the GYM ..",PlayerName(playerid),playerid);
            
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
            return 
1;
        }
        return 
1;
    } 
But i want to remake it to this But how can i do it ?;/

Edit this more like and ignition system for the old robbery system

PHP код:
    public OnFilterScriptInit() {
//GYM
    
CreateObject(2332754.16119, -40.84430999.99481,   0.000000.0000090.00000);
    return 
1;
}
//If In range
    
if OnPlayerCommandText(playerid"/robstore"))
{
    if(
IsPlayerInRangeOfPoint(playerid7.0754.16119, -40.84430999.99481))
{
    
SendClientMessage(playerid,0xFFFFFFFF,"Press C to start robbery!");
}
    if 
GYMRobbedRecently =0(playerid
    
return 1;
}
//Keybind
    
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_CROUCH))
{
    if(
IsPlayerInRangeOfPoint(playerid7.0754.16119, -40.84430999.99481))
{
    
OnPlayerCommandText(playerid"/robstore");
}
}
    return 
1;
}
//Timer
    
forward message();
    public 
OnGameModeInit()
{
    print(
"You have started to rob the GYM");
    
SetTimer("message"25000false); 
}
    public 
message()
{
    
format(string,sizeof(string),"{FFFF00}%s(%d) {FFFFFF}has Robbed a total of {00FFFF}$%d {FFFFFF}from the GYM In {BA55D3}Garcia",pname,i,mrand);
    
SendClientMessageToAll(COLOR_PURPLE,string);
    
format(string,sizeof(string),"4{FFFF00}%s(%d) {FFFFFF}has Robbed a total of {00FFFF}$%d {FFFFFF}from the GYM In {BA55D3}Garcia",pname,i,mrand);
    
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    
    return 
1

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)