how make you are not in jail!
#1

hey how can i make if player is not in jail to send client message you cant usething command you are not in jail please

PHP код:
dcmd_escape(playerid,params[])
{
    
#pragma unused params
    
new string[128];
    new 
ID;
    if(
InAdminMode[ID] == 1)
    {
        
SendClientMessage(playerid,COLOR_RED,"[ERROR]:You cannot use this command on this player because they are in Administrator mode.");
        return 
1;
    }
    if(
IsSpawned[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_RED,"[ERROR]:You must be alive and spawned in order to be able to use this command.");
        return 
1;
     }
    if(
IsKidnapped[playerid] == 1)
    {
        
SendClientMessage(playerid,COLOR_RED,"[ERROR]:You are kidnapped. You cannot use this command.");
        return 
1;
    }
    if(
IsFrozen[playerid] == 1)
    {
        
SendClientMessage(playerid,COLOR_RED,"{ERROR}:You have been frozen by a Server Administrator. You cannot use this command.");
        return 
1;
    }
    if(
gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_MEDIC)
    {
         
SendClientMessage(playerid,COLOR_RED,"[ERROR]: You Cannot Escape Only Civilians can!");
        return 
1;
    }
    if(
AttemptedToRobRecently[playerid] >= 1)
    {
        
SendClientMessage(playerid,COLOR_RED,"[Tired]:You are too tired from your last Escape attempt. Please wait before trying to escape again.");
        return 
1;
    }
    new 
crand random(100);
    if(
crand <= 30)
    {
        
SendClientMessage(playerid,COLOR_RED,"[FAIL]:Escape attempt failed. Cops Has Return you to jail With more time!.");
        
AttemptedToRobRecently[playerid] =125;
        return 
1;
    }
    
format(string,sizeof(string),"[Civilian ACTION!]%s(%d) has Escape From San Fierro Prison!.",PlayerName(playerid),playerid,PlayerName(ID),ID);
    
SendClientMessageToAll(COLOR_ORANGE,string);
    
format(string,sizeof(string),"7[Civilian ACTION!] %s(%d) has Escape From San Fierro Prison!.",PlayerName(playerid),playerid,PlayerName(ID),ID);
    
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    
GameTextForPlayer(playerid,"~r~ escaped!",1000,4);
    
SendClientMessage(playerid,COLOR_RED,"[ESCAPED!]:You Have Escape From SFPD Jail! Run Cops Are on there way!");
    
IncreaseWantedLevel(playerid,8);
    
HasRobbedRecently[playerid] =23;
    
IncreasePlayerScore(playerid,2);
    
TotalJailTime[playerid] =0;
    
JailTime[playerid] =0;
    
TextDrawHideForPlayer(playerid,JailTimer[playerid]);
    
SetPlayerPos(playerid,225.8451,112.8976,1003.2188);
    
SetPlayerFacingAngle(playerid,1.0816);
    
SetCameraBehindPlayer(playerid);
    return 
1;


i made /escape command and it work perfect all i need it to not use it out side like if u are not in jail u cant use this command
Reply


Messages In This Thread
how make you are not in jail! - by UserName31 - 11.07.2012, 18:38
Re: how make you are not in jail! - by clarencecuzz - 11.07.2012, 19:23
Re: how make you are not in jail! - by UserName31 - 11.07.2012, 20:08

Forum Jump:


Users browsing this thread: