sub-sub...cmd zcmd
#1

Hello, i have a problem

PHP код:
CMD:police(playerid,params[]){
    if(
pinfo[playerid][Faction] != 1) return SCM(playerid,ROUGE,">"blanc" Tu n'es pas de la LSPD.");
    if(
isnull(params)) return SCM(playerid,GRIS,">"blanc" /police [service, equiper, uniforme, arreter, camera, listecamera, megaphone]");
    if(!
strcmp(params"service"true7)){
        if(!
IsPlayerInRangeOfPoint(playerid5.0SERVICELSPD)) return SCM(playeridROUGE"> "blanc"Tu n'est pas aux vestiaires pour pouvoir te mettre en service.");
        if(
EnService[playerid] == 0){
            
SetArmour(playerid100);
            
SCM(playeridVERTC"> "blanc"Tu es en service de police");
            
SetPlayerColor(playeridTEAM_HIT_COLOR_BLEU);
            
SetHealth(playerid100);
            
PlayerVie[playerid] = 100;
            
CountFlic++;
            
EnService[playerid] = 1;
        }
        else{
            
CountFlic--;
            
EnService[playerid] = 0;
            
SetPlayerSkin(playeridpinfo[playerid][Skin]);
            
SCM(playeridVERTC"> "blanc"Tu n'es plus en service de police");
            
SetPlayerColor(playeridTEAM_HIT_COLOR);
            
ResetPlayerWeapons(playerid);
            
SetArmour(playerid0);
            
PlayerArmure[playerid] = 0;
            
PlayerMunitions[playerid] = 0;
            
pinfo[playerid][Cagoule] = 0;
            
RemovePlayerAttachedObject(playerid7);
            
RemovePlayerAttachedObject(playerid8);
            
RemovePlayerAttachedObject(playerid9);
           }
    }
    
    else if(!
strcmp(params"equiper"true7)){
        if(!
IsPlayerInRangeOfPoint(playerid5.0SERVICELSPD)) return SCM(playeridROUGE"> "blanc"Tu n'est pas aux vestiaires pour pouvoir mettre ton йquipement.");
        
ShowPlayerDialog(playeridDIALOG_EQUIPLSPDDIALOG_STYLE_LIST"Equipement LSPD""Matraque\nBombe а gaz\nCamera\n9mm\n9mm silencieux\nDesert Eagle\nShotgun\nCombat Shotgun\nMP5\nM4\nSniper\nGrenades""Oui""Non");
    }
    
    else if(!
strcmp(params"uniforme"true8)){
        if(!
IsPlayerInRangeOfPoint(playerid5.0SERVICELSPD)) return SCM(playeridROUGE"> "blanc"Tu n'est pas aux vestiaires pour pouvoir te mettre en uniforme");
        
ShowModelSelectionMenu(playeridskinlspd"Habits LSPD");
    }
    
    else if(!
strcmp(params"arreter"true7)){
        new 
targetidsecondsraison[80], cellstr[128], Float:vieFloat:xFloat:yFloat:z;
        if(!
IsPlayerInRangeOfPoint(playerid5.0POS_ARRETERPOLICE)) return SCM(playeridROUGE"> "blanc"Tu n'es pas au bonne endroit pour faire cette commande");
        if(
sscanf(params"udds[80]"targetidcellsecondsraison)) return SCM(playeridGRIS"> "blanc"/police arreter [playerid] [cellule] [minutes] [raison]");
        if(
PlayerConnecter[targetid] == false) return SCM(playeridROUGE"> "blanc"Ce joueur n'est pas connectй");
        if(
seconds || seconds 3600) return SCM(playeridROUGE"> "blanc"Tu ne peux pas aller en dessous de 0 minutes ni au dessus de 3600");
        if(
cell || cell 4) return SCM(playeridROUGE">"blanc" Cellule numйro 1, 2, 3 ou 4.");
        
GetPlayerPos(targetidxyz);
        if(!
IsPlayerInRangeOfPoint(playerid30.0xyz)) return SCM(playeridROUGE"> "blanc"Il est trop loin de toi.");
        
GetPlayerHealth(targetidvie);
        
pinfo[targetid][Jail] = cell;
        
pinfo[targetid][JailTime] = 60*seconds;
        
TimerJailTime[targetid] = SetTimerEx("JailTimer"SECONDS(10), true"i"targetid);
        if(
pinfo[targetid][Jail] == 1){
            
SetPlayerPos(targetidPOS_CELLULEPDP1);
        }
        if(
pinfo[targetid][Jail] == 2){
            
SetPlayerPos(targetidPOS_CELLULEPDP2);
        }
        if(
pinfo[targetid][Jail] == 3){
            
SetPlayerPos(targetidPOS_CELLULEPDP3);
        }
        if(
pinfo[targetid][Jail] == 4){
            
SetPlayerPos(targetidPOS_CELLULEPDP4);
        }
        
format(strsizeof(str), "> "blanc"%s viens d'arrкter le suspect %s pour %s"RPName(playerid), RPName(targetid), raison);
        
SCMTA(BLEUCstr);
        
printf("%s vient d'arrкter le suspect %s pour %s pendant %d minutes"RPName(playerid), RPName(targetid), raisonseconds*60);
        if(
pinfo[targetid][Dette] > 2500){
            
SCM(playeridORANGE"> "blanc"Tes dettes sont revenue а zйro");
            
pinfo[targetid][Dette] = 0;
        }
    }
    else if(!
strcmp(params"camera"true6)){
        new 
cameraidpath[32];
        if(
EnService[playerid] == 0) return SCM(playeridROUGE"> "blanc" Vous n'кtes pas en service.");
        if(
CameraSpec[playerid] == false){
            new 
Float:xFloat:yFloat:z;
            if(!
IsPlayerInRangeOfPoint(playerid5.0POS_CAMERAPOLICE)) return SCM(playeridROUGE"> "blanc"Tu n'es pas au bureau des camйras");
            if(
sscanf(params"d"cameraid)) return SCM(playeridGRIS"> "blanc"/police camera [id camera]"), SCM(playerid,JAUNE,">"blanc" Utilisez /listecamera pour voir la liste.");
            
format(pathsizeof(path), CPATHcameraid);
            if(!
fexist(path)) return SCM(playeridROUGE"> "blanc"Cette camera n'existe pas");
            
pinfo[playerid][pInt] = pinfo[playerid][Int];
            
pinfo[playerid][pVw] = pinfo[playerid][Vw];
            
GetPlayerPos(playeridxyz);
            
pinfo[playerid][Pos_X] = x;
            
pinfo[playerid][Pos_Y] = y;
            
pinfo[playerid][Pos_Z] = z;
            
TogglePlayerSpectating(playerid1);
            
InterpolateCameraPos(playeridcinfo[cameraid][Pos_X], cinfo[cameraid][Pos_Y], cinfo[cameraid][Pos_Z], cinfo[cameraid][Pos_X], cinfo[cameraid][Pos_Y], cinfo[cameraid][Pos_Z], SECONDS(1), CAMERA_CUT);
            
CameraSpec[playerid] = true;
            
SetPlayerInterior(playeridcinfo[cameraid][Int]);
            
SetPlayerVirtualWorld(playeridcinfo[cameraid][Vw]);
            
SCM(playeridORANGE"> "blanc"/camera pour sortir du mode camera");
        }
        else{
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Weapon1a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Weapon2a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Weapon3a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Weapon4a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Weapon5a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Weapon6a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Weapon7a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Weapon8a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Weapon9a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Weapon10a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Weapon11a]);
            
GiveWeapon(playeridWeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Weapon12a]);
            
TogglePlayerSpectating(playerid0);
            
gSpectateID[playerid] = INVALID_PLAYER_ID;
            
gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
            
CameraSpec[playerid] = false;
            if(
skinjob[playerid] == 0){
                
SetPlayerSkin(playerid,pinfo[playerid][Skin]);
            }
            if(
skinjob[playerid] != 0){
                
SetPlayerSkin(playeridskinjob[playerid]);
            }
            
ELC_AC_SetPlayerPos(playeridPOS_CAMERAPOLICE);
            
TogglePlayerControllable(playerid,0);
            
SetTimerEx("UnFreezePlak"3000false"i"playerid);
            
SetPlayerInterior(playerid0);
            
PdpInt(playerid);
            
SetPlayerVirtualWorld(playeridpinfo[playerid][pVw]);
        }
    }
    
    else if(!
strcmp(params"listecamera"true11)){
        new 
path[32], str[64];
        for(new 
0MAX_CAMERASi++){
            
format(pathsizeof(path), CPATHi);
            if(
fexist(path)){
                 
format(strsizeof(str), "Camera id: %d, %s"icinfo[i][Name]);
                
SCM(playeridBLEUCstr);
            }
        }
    }
    
    else if(!
strcmp(params"megaphone"true9)){
        new 
str[120], txt[120];
        if(
sscanf(params"s[120]"txt)) return SCM(playeridGRIS"> "blanc"/police megaphone [message]");
        
format(strsizeof(str), ""jaune"[MEGAPHONE]:"blanc" %s"txt);
        
SendWhisperMessage(20.0playeridBLANCstr);
    }
    return 
1;

/police service, listecamera, equiper, uniforme its good
but /police megaphone, arreter, camera its not good
can you help me please ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)