BIG HELP [ROB]
#1

PHP код:
#include <a_samp>
#include <streamer>
#include <zcmd>
//colors
#define COLOR_RED 0xFF0000AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREEN 0x33AA33AA
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_ORANGE 0xFFA500AA
//variables
new ROBBING_TATOO[MAX_PLAYERS]; //used when you rob
new tatoorobbedrecently =0// to make the players wait before robbing more
new CP_junk;
new 
CP_mall;
public 
OnPlayerSpawn(playerid)
{
    
CP_junk CreateDynamicCP(-60.8519,-1592.9888,2.61072.0, -1, .interiorid = -1);
    
CP_junk CreatePickup(131823,-60.8519,-1592.9888,2.6107, -1);
    
CP_mall CreateDynamicCP(397.1805,-1805.6731,7.83802.0, -1, .interiorid = -1);
    
CP_mall CreatePickup(131823397.1805,-1805.6731,7.8380, -1);
    return 
1;
    }
    
    public 
OnPlayerEnterDynamicCP(playeridcheckpointid//Add this anywhere
{
   if(
checkpointid == CP_junk || checkpointid == CP_mall//Checking if player is in the checkpoint "Tatoo"
   
{
       
SendClientMessage(playeridCOLOR_RED"Start robbery by typing /robstore"); //Sending message so that player knows that to rob. he must type this command
   
}
   return 
1;
}
CMD:robstore(playeridparams[])
{
    
#pragma unused params // we dont need the params
    
if(IsPlayerInDynamicCP(playeridCP_junk) || IsPlayerInDynamicCP(playeridCP_mall)) // Checking if player is in the checkpoint
    
{
        if(
tatoorobbedrecently >=1//checking if tatoo shop has been robbed recently
        
{
            
SendClientMessage(playeridCOLOR_RED"Sorry, This place is recently robbed"); // sending error message
             
return 1;
        }
        
ROBBING_TATOO[playerid] = 60// setting the robbery timer
        
tatoorobbedrecently =180// Time the players needs to wait for starting an another robbery in the same place
    
}
    return 
1;
}
forward ServerRobbery();
public 
OnGameModeInit()
{
    
SetTimer("ServerRobbery",1000,1);// Ticks every 1 second
    
return 1;
    }
    
    public 
ServerRobbery()
{
         for(new 
i=0i<MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i)) // checking if player connected
            
{
                
//ROBBERIES
                  
if(ROBBING_TATOO[i] > 1// Checking if robbery time is above 1
                
{
                    
ROBBING_TATOO[i] --; // Decreasing time
                    
new time[20]; //adding time variable
                      
format(time,sizeof(time),"Robbery Time: %d",ROBBING_TATOO[i]);
                    
GameTextForPlayer(i,time,500,3); //shows gametext showing the time remaining for the robbery
                
}
                if(
ROBBING_TATOO[i] == 1// IF the timer reached 1
                
{
                    new 
string[64], pName[MAX_PLAYER_NAME];// getting player name
                    
GetPlayerName(i,pName,MAX_PLAYER_NAME);
                    
SendClientMessage(iCOLOR_GREEN"Robbery Complete"); //sending message to the player that robbery was complete
                    
SetPlayerWantedLevel(iGetPlayerWantedLevel(i) + 1); //giving player 1 wanted level
                    
ROBBING_TATOO[i] =0// RESET timer
                    
new mrand =random(50000);
                     
GivePlayerScore(i,1);
                    
format(string,sizeof(string),"[ROBBERY] %s(%d) has robbed a total of $%d from the  shop! LOL!",pName,i,mrand);
                    
SendClientMessageToAll(COLOR_RED,string);
                    
GivePlayerMoney(imrand);
                }
            }
        }
        return 
1;
}
stock GivePlayerScoreplayeridscore SetPlayerScoreplayeridGetPlayerScoreplayerid ) + score ); 
actually after making this i cant see the checkpoint either the pickup help me cordinates are fixed but still
Reply
#2

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)