17.08.2016, 19:41
Hello, i have a problem
/police service, listecamera, equiper, uniforme its good
but /police megaphone, arreter, camera its not good
can you help me please ?
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", true, 7)){
if(!IsPlayerInRangeOfPoint(playerid, 5.0, SERVICELSPD)) return SCM(playerid, ROUGE, "> "blanc"Tu n'est pas aux vestiaires pour pouvoir te mettre en service.");
if(EnService[playerid] == 0){
SetArmour(playerid, 100);
SCM(playerid, VERTC, "> "blanc"Tu es en service de police");
SetPlayerColor(playerid, TEAM_HIT_COLOR_BLEU);
SetHealth(playerid, 100);
PlayerVie[playerid] = 100;
CountFlic++;
EnService[playerid] = 1;
}
else{
CountFlic--;
EnService[playerid] = 0;
SetPlayerSkin(playerid, pinfo[playerid][Skin]);
SCM(playerid, VERTC, "> "blanc"Tu n'es plus en service de police");
SetPlayerColor(playerid, TEAM_HIT_COLOR);
ResetPlayerWeapons(playerid);
SetArmour(playerid, 0);
PlayerArmure[playerid] = 0;
PlayerMunitions[playerid] = 0;
pinfo[playerid][Cagoule] = 0;
RemovePlayerAttachedObject(playerid, 7);
RemovePlayerAttachedObject(playerid, 8);
RemovePlayerAttachedObject(playerid, 9);
}
}
else if(!strcmp(params, "equiper", true, 7)){
if(!IsPlayerInRangeOfPoint(playerid, 5.0, SERVICELSPD)) return SCM(playerid, ROUGE, "> "blanc"Tu n'est pas aux vestiaires pour pouvoir mettre ton йquipement.");
ShowPlayerDialog(playerid, DIALOG_EQUIPLSPD, DIALOG_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", true, 8)){
if(!IsPlayerInRangeOfPoint(playerid, 5.0, SERVICELSPD)) return SCM(playerid, ROUGE, "> "blanc"Tu n'est pas aux vestiaires pour pouvoir te mettre en uniforme");
ShowModelSelectionMenu(playerid, skinlspd, "Habits LSPD");
}
else if(!strcmp(params, "arreter", true, 7)){
new targetid, seconds, raison[80], cell, str[128], Float:vie, Float:x, Float:y, Float:z;
if(!IsPlayerInRangeOfPoint(playerid, 5.0, POS_ARRETERPOLICE)) return SCM(playerid, ROUGE, "> "blanc"Tu n'es pas au bonne endroit pour faire cette commande");
if(sscanf(params, "udds[80]", targetid, cell, seconds, raison)) return SCM(playerid, GRIS, "> "blanc"/police arreter [playerid] [cellule] [minutes] [raison]");
if(PlayerConnecter[targetid] == false) return SCM(playerid, ROUGE, "> "blanc"Ce joueur n'est pas connectй");
if(seconds < 0 || seconds > 3600) return SCM(playerid, ROUGE, "> "blanc"Tu ne peux pas aller en dessous de 0 minutes ni au dessus de 3600");
if(cell < 0 || cell > 4) return SCM(playerid, ROUGE, ">"blanc" Cellule numйro 1, 2, 3 ou 4.");
GetPlayerPos(targetid, x, y, z);
if(!IsPlayerInRangeOfPoint(playerid, 30.0, x, y, z)) return SCM(playerid, ROUGE, "> "blanc"Il est trop loin de toi.");
GetPlayerHealth(targetid, vie);
pinfo[targetid][Jail] = cell;
pinfo[targetid][JailTime] = 60*seconds;
TimerJailTime[targetid] = SetTimerEx("JailTimer", SECONDS(10), true, "i", targetid);
if(pinfo[targetid][Jail] == 1){
SetPlayerPos(targetid, POS_CELLULEPDP1);
}
if(pinfo[targetid][Jail] == 2){
SetPlayerPos(targetid, POS_CELLULEPDP2);
}
if(pinfo[targetid][Jail] == 3){
SetPlayerPos(targetid, POS_CELLULEPDP3);
}
if(pinfo[targetid][Jail] == 4){
SetPlayerPos(targetid, POS_CELLULEPDP4);
}
format(str, sizeof(str), "> "blanc"%s viens d'arrкter le suspect %s pour %s", RPName(playerid), RPName(targetid), raison);
SCMTA(BLEUC, str);
printf("%s vient d'arrкter le suspect %s pour %s pendant %d minutes", RPName(playerid), RPName(targetid), raison, seconds*60);
if(pinfo[targetid][Dette] > 2500){
SCM(playerid, ORANGE, "> "blanc"Tes dettes sont revenue а zйro");
pinfo[targetid][Dette] = 0;
}
}
else if(!strcmp(params, "camera", true, 6)){
new cameraid, path[32];
if(EnService[playerid] == 0) return SCM(playerid, ROUGE, "> "blanc" Vous n'кtes pas en service.");
if(CameraSpec[playerid] == false){
new Float:x, Float:y, Float:z;
if(!IsPlayerInRangeOfPoint(playerid, 5.0, POS_CAMERAPOLICE)) return SCM(playerid, ROUGE, "> "blanc"Tu n'es pas au bureau des camйras");
if(sscanf(params, "d", cameraid)) return SCM(playerid, GRIS, "> "blanc"/police camera [id camera]"), SCM(playerid,JAUNE,">"blanc" Utilisez /listecamera pour voir la liste.");
format(path, sizeof(path), CPATH, cameraid);
if(!fexist(path)) return SCM(playerid, ROUGE, "> "blanc"Cette camera n'existe pas");
pinfo[playerid][pInt] = pinfo[playerid][Int];
pinfo[playerid][pVw] = pinfo[playerid][Vw];
GetPlayerPos(playerid, x, y, z);
pinfo[playerid][Pos_X] = x;
pinfo[playerid][Pos_Y] = y;
pinfo[playerid][Pos_Z] = z;
TogglePlayerSpectating(playerid, 1);
InterpolateCameraPos(playerid, cinfo[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(playerid, cinfo[cameraid][Int]);
SetPlayerVirtualWorld(playerid, cinfo[cameraid][Vw]);
SCM(playerid, ORANGE, "> "blanc"/camera pour sortir du mode camera");
}
else{
GiveWeapon(playerid, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Weapon1a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Weapon2a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Weapon3a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Weapon4a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Weapon5a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Weapon6a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Weapon7a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Weapon8a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Weapon9a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Weapon10a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Weapon11a]);
GiveWeapon(playerid, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Weapon12a]);
TogglePlayerSpectating(playerid, 0);
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(playerid, skinjob[playerid]);
}
ELC_AC_SetPlayerPos(playerid, POS_CAMERAPOLICE);
TogglePlayerControllable(playerid,0);
SetTimerEx("UnFreezePlak", 3000, false, "i", playerid);
SetPlayerInterior(playerid, 0);
PdpInt(playerid);
SetPlayerVirtualWorld(playerid, pinfo[playerid][pVw]);
}
}
else if(!strcmp(params, "listecamera", true, 11)){
new path[32], str[64];
for(new i = 0; i < MAX_CAMERAS; i++){
format(path, sizeof(path), CPATH, i);
if(fexist(path)){
format(str, sizeof(str), "Camera id: %d, %s", i, cinfo[i][Name]);
SCM(playerid, BLEUC, str);
}
}
}
else if(!strcmp(params, "megaphone", true, 9)){
new str[120], txt[120];
if(sscanf(params, "s[120]", txt)) return SCM(playerid, GRIS, "> "blanc"/police megaphone [message]");
format(str, sizeof(str), ""jaune"[MEGAPHONE]:"blanc" %s", txt);
SendWhisperMessage(20.0, playerid, BLANC, str);
}
return 1;
}
but /police megaphone, arreter, camera its not good
can you help me please ?