Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Probleme comanda /megaphone


Question

Posted

Care ma puteti ajuta cu aceasta comanda /megaphone imi spune ca nu sunt in vehicului factiuni si defapt sunt. 

 

YCMD:megaphone(playerid, params[], help) {
    new tmpcar = GetPlayerVehicleID(playerid),textmeg[250],string[200];
    if(PlayerInfo[playerid][pMuted] == 1) {
        format(string, sizeof(string), "You can't talk right now! You are muted. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
        SCM(playerid, COLOR_GREY, string);
        return 1;
    }
    if(sscanf(params, "s[250]", textmeg)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/m <text>");
    if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu faci parte din factiunea politiei.");
    if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
    if(!Copcar2(tmpcar)) return SCM(playerid, COLOR_GREY, "Nu esti intr-un vehicul de-al factiunii.");
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1) format(string, sizeof(string), "> Ofiter %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2) format(string, sizeof(string), "> Agent %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3) format(string, sizeof(string), "> Soldat %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 14||PlayerInfo[playerid][pLeader] == 14) format(string, sizeof(string), "> Capitan %s: %s <", GetName(playerid), textmeg);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    return 1;
}

 

 

function IsACopCar(carid) {
    if(ServerVehicles[carid][vFaction] == 1) return 1;
    return 0;
}

function Copcar2(carid) {
    if(ServerVehicles[carid][vFaction] == 1) return 1;
    if(ServerVehicles[carid][vFaction] == 2) return 1;
    if(ServerVehicles[carid][vFaction] == 3) return 1;
    if(ServerVehicles[carid][vFaction] == 14) return 1;
    return 0;
}

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Presupun ca e gm burned si daca da, daca nu i-ai adaugat o factiune, scoate tot ce are legatura cu factiunea 14 pentru ca nu exista in baza de date...

function Copcar2(carid) {
    if(ServerVehicles[carid][vFaction] == 1) return 1;
    if(ServerVehicles[carid][vFaction] == 2) return 1;
    if(ServerVehicles[carid][vFaction] == 3) return 1;
    return 0;
}
YCMD:megaphone(playerid, params[], help) {
    new tmpcar = GetPlayerVehicleID(playerid),textmeg[250],string[200];
    if(PlayerInfo[playerid][pMuted] == 1) {
        format(string, sizeof(string), "You can't talk right now! You are muted. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
        SCM(playerid, COLOR_GREY, string);
        return 1;
    }
    if(sscanf(params, "s[250]", textmeg)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/m <text>");
    if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu faci parte din factiunea politiei.");
    if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
    if(!Copcar2(tmpcar)) return SCM(playerid, COLOR_GREY, "Nu esti intr-un vehicul de-al factiunii.");
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1) format(string, sizeof(string), "> Ofiter %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2) format(string, sizeof(string), "> Agent %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3) format(string, sizeof(string), "> Soldat %s: %s <", GetName(playerid), textmeg);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    return 1;
}

 

Edited by CTMBeast
  • 0
Posted
On 12/30/2018 at 9:49 AM, DavidTKD said:

Care ma puteti ajuta cu aceasta comanda /megaphone imi spune ca nu sunt in vehicului factiuni si defapt sunt. 

 

YCMD:megaphone(playerid, params[], help) {
    new tmpcar = GetPlayerVehicleID(playerid),textmeg[250],string[200];
    if(PlayerInfo[playerid][pMuted] == 1) {
        format(string, sizeof(string), "You can't talk right now! You are muted. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
        SCM(playerid, COLOR_GREY, string);
        return 1;
    }
    if(sscanf(params, "s[250]", textmeg)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/m <text>");
    if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu faci parte din factiunea politiei.");
    if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
    if(!Copcar2(tmpcar)) return SCM(playerid, COLOR_GREY, "Nu esti intr-un vehicul de-al factiunii.");
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1) format(string, sizeof(string), "> Ofiter %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2) format(string, sizeof(string), "> Agent %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3) format(string, sizeof(string), "> Soldat %s: %s <", GetName(playerid), textmeg);
    else if(PlayerInfo[playerid][pMember] == 14||PlayerInfo[playerid][pLeader] == 14) format(string, sizeof(string), "> Capitan %s: %s <", GetName(playerid), textmeg);
    ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    return 1;
}

 

 

function IsACopCar(carid) {
    if(ServerVehicles[carid][vFaction] == 1) return 1;
    return 0;
}

function Copcar2(carid) {
    if(ServerVehicles[carid][vFaction] == 1) return 1;
    if(ServerVehicles[carid][vFaction] == 2) return 1;
    if(ServerVehicles[carid][vFaction] == 3) return 1;
    if(ServerVehicles[carid][vFaction] == 14) return 1;
    return 0;
}

Functioneaza ce ti-am dat?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.