How to make /escape command please help
#1

hey i have this escape command but how can i added to my script?


here is the escape commands

PHP код:
public OnPlayerCommandText(playerid,cmdtext[]){
    if(!
strcmp(cmdtext,"/Escape",true)){
       
        
//If the player is not in jail, stop processing the command
        
if( Is Player In Jail == 0){
            return 
SendClientMessage(playerid,0xFF0000FF,"You are not in jail.");
        }
       
        
//If the player has already failed to escape from jail 2 times, stop processing the command
        
if( Escape Attempts >=2){
            return 
SendClientMessage(playerid,0xFF0000FF,"You have already failed to escape from jail twice!");
        }
        
//When the player is unjailed/connects to the server, you will need to set the variable for escape attempts to 0
       
        //Give the player a 1 in 4 chance of escaping (25%)
        
new chance=random(4);
       
        
//If the random function returns a value of 1 (returns values between 0-3: https://sampwiki.blast.hk/wiki/Random)
        
if(chance==1){
            
//The player has escaped jail
            
Player Jail Time 0;
            
SetPlayerWantedLevel(playerid,6);
            
GameTextForPlayer(playerid,"You have escaped from jail!~n~~r~Run!",5000,4);
            
SetPlayerPos(playerid,x,y,z);//Set their position to outside the jail/police station
            
SetPlayerInterior(playerid,0);
        }
        else {
            
//The player failed to escape jail
            
GameTextForPlayer(playerid,"~w~You ~r~failed~w~ to escape from jail!",5000,4);
            
Escape Attempts++;
        }
       
        return 
1;
    }
    return 
0;


Here is the script:



PHP код:
#include <a_samp>
#include <dudb>
#include <CPLoader>
#include <ladmin>
/*x---------------------------------Defining-------------------------------------x*/
//**COLORS*//
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000FFAA
#define blue 0x0000FFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_ORANGE 0xFF9933AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLACK 0x2C2727AA
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_AQUA 0x7CFC00AA
#define COLOR_WHITEYELLOW 0xFFE87DFF
#define COLOR_BLUEAQUA 0x7E60FFFF
#define COLOR_DARKBLUE 0x15005EFF
#define COLOR_ALIEN 0x90FF87FF
#define COLOR_GOLD 0xB8860BAA
#define KICK_COLOR 0xFF0000FF
#define COLOR_GANGGREEN 0x00FF0096
#define COLOR_BLACK 0x2C2727AA
#define COLOR_SBLUE 0x00BFFFAA
#define WHITE 0xF6F6F6AA
#define GREY 0xC6C6C6AA
#define RED 0xF60000AA
#define COLOR_ERROR 0xF60000AA
#define COLOR_RED 0xAA3333AA
#define LIGHT_BLUE 0x00A4F6AA
#define BLUE 0x0000F6AA
#define DARK_BLUE 0x0000AFAA
#define LIGHT_GREEN 0x00F600AA
#define GREEN 0x00AD00AA
#define DARK_GREEN 0x005000AA
#define YELLOW 0xF6F600AA
#define ORANGE 0xF67F00AA
#define BLACK 0x000000AA
#define COLOR_ROYALBLUE 0x4169FFAA
#define PINK 0xFF6EC7AA
#define SERVER_COLOR 0x85F600AA
#define ERROR 0x990000AA
#define COLOR_MSG 0x00FFFFFF //Color of general messages
#define STUNNED_TIME 4 //The time in seconds the stun lasts
#define ANTISPAM 5 //The minimum allowed time between /taze commands
#define COLOR_KILLED 0x880000FF //The color, when a player gets killed by tazing
#define CIVILIAN 0
#define Medic 1
#define COP 2
#define FBI 3
#define SWAT 4
#define ARMY 5
//--------------Taxi-----------
#define BAJADA_DE_BANDERA 500
#define PRECIO_FICHA 300
#define COLOR_YELLOW 0xFFFF00AA
//-----------------------------
/* ----------HIT COMMAND----------*/
#define COLOR_FOUND 0xFFFF00AA //Color of the message if a hit was found in /hits
#define COLOR_MSG 0x00FFFFFF //Color of general messages
#define ANTISPAM_TIME 5 //The minimum time between /hit commands to prevent spam (in seconds)
/*----------NO NEED TO EDIT FROM HERE----------*/
#define MAX_PLAYERS_ 50
#define SPAWN_GAS_MIN      35
#define SPAWN_GAS_MAX      100
#define MAX_START_TIME     3
#define BAJADA_DE_BANDERA2 500
#define PRECIO_FICHA2 300
#define RegisterName 1
#define LoginName 2
#define SendFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessage(%0,%1,_str);}while(FALSE)
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
static gTeam[MAX_PLAYERS];
new 
GPSTimer[MAX_PLAYERS];
new 
bool:HaveGPS[MAX_PLAYERS];
enum aInfo
{
        
aLevel
}
;
new 
AccountInfo[MAX_PLAYERS][aInfo];
new 
RecentlyRobbed[MAX_PLAYERS];
new 
ATMRecentlyRobbed;
new 
DildoRecentlyRobbed;
new 
HallRecentlyRobbed;
new 
RentalRecentlyRobbed;
new 
BankRecentlyRobbed;
new 
BincoRecentlyRobbed;
new 
ZipRecentlyRobbed;
new 
UrbanRecentlyRobbed;
new 
AmmuRecentlyRobbed;
new 
Ammu2RecentlyRobbed;
new 
Ammu3RecentlyRobbed;
new 
Ammu4RecentlyRobbed;
new 
Ammu5RecentlyRobbed;
new 
DrugsRecentlyRobbed;
new 
D4RecentlyRobbed;
new 
CaRecentlyRobbed;
new 
gPlayerUsingLoopingAnim[MAX_PLAYERS];
new 
animation[200];
//BUS
new OnBusAsPassenger[MAX_PLAYERS];
new 
CostoDelViaje2[MAX_PLAYERS];
new 
contador2[MAX_PLAYERS];
new 
playerInMiniMission2[MAX_PLAYERS];
new 
avisado2[MAX_PLAYERS];
new 
caidadeficha2Timer2;
new 
cantidadPasajeros2;
forward terminarMission2(playerid);
forward caidadeficha2();
//
new IsSpawned[MAX_PLAYERS];
new 
SelectBM[MAX_PLAYERS];
new 
PlayerSkin[MAX_PLAYERS];
new 
SelectTM[MAX_PLAYERS];
new 
InTrashMission[MAX_PLAYERS];
new 
time;
new 
Muted[MAX_PLAYERS];
new 
ticketmen[MAX_PLAYERS];
//Lotto
#define yellow                     0xFFFF00AA
#define green                    0x33FF33AA
#define white                    0xFFFFFFAA
#define red                         0xFF0000AA
#define grgreen                    0x33AA33AA
#define SORSOLASTIMER             120000      // 2 perc
#define HIRDETESTIMER           180000      // 3 min
#define ALTERNATIVE_MAX_PLAYERS 500
//¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
new bool:HaveTicket[ALTERNATIVE_MAX_PLAYERS];
new 
NyeroSzamok[6][ALTERNATIVE_MAX_PLAYERS];
new 
KisorsoltSzamok[6];
new 
TimerKill[2];
new 
output2[128];
forward Sorsolas();
forward GPSUpdate(playerid,playerid2);
//
//Text Draws
new Text:BOX;
new 
Text:Welcome;
new 
Text:text1;
new 
Text:text2;
new 
Text:text3;
new 
Text:BOX2;
new 
Text:CIVBOX;
new 
Text:text6;
new 
Text:text7;
new 
Text:text8;
new 
Text:text9;
new 
Text:text10;
new 
Text:HALLBOX;
new 
Text:COPBOX;
new 
Text:MDCBOX;
new 
Text:text11;
new 
Text:text13;
new 
Text:text14;
new 
Text:text15;
new 
Text:text16;
new 
Text:text17;
new 
Text:text18;
new 
Text:text19;
new 
Text:text20;
new 
Text:text21;
new 
Text:text22;
new 
Text:text23;
new 
Text:CMDBOX;
new 
Text:BUSBOX;
new 
Text:text24;
new 
Text:text25;
new 
Text:text26;
new 
Text:text27;
new 
Text:BBOX;
new 
Text:text35;
new 
Text:text37;
new 
Text:text38;
new 
Text:text39;
new 
Text:text40;
new 
Text:AMMUBOX1;
new 
Text:AMMUBOX2;
new 
Text:text41;
new 
Text:text42;
new 
Text:text43;
new 
Text:PCBOX;
new 
Text:text44;
new 
Text:text45
And here the something helpfull i think

PHP код:
public OnPlayerCommandText(playeridcmdtext[]) 
and
PHP код:
if(strcmp(cmd"/login"true) == 0
see if yaa can get clu from my script if need more stuff tell me ill put them
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)