ZCMD: LSPD Hotline ( /call 199 ) [+REP]
#1

Alright, well i'm trying to make something like
"When Civilian 1 calls 199 it will RING all Cops online, like a Global Cop Message saying " Somebody_Somebody is calling to the LSPD Hotline, type /pcall to answer it"

Then when a cop answers it, it will send a message to cops the Cop that answered (Name of Cop, Accepted the 199 call from Name of Civilian) then the Civilian that called and the Cop can talk..

Hmm, how will i be able to do this? I'm not that "good" in Pawno and i'm a Learner currently..

++ Rep for people who will answer, thank you
Reply
#2

Try something like this.

pawn Код:
foreach(Player, i)
{
        if(PlayerInfo[i][pFaction(whatever you have here) == 1) return SendClientMessage(i, -1, "blah blah");
}
This is just a idea for you how you should try to make it. So don't hate saying "That's no help".
Reply
#3

something like this, not perfect, not tested may contain errors, as i made it here in this little box x:, anyways, this is just an example.
pawn Код:
new help, helped; //this will be declared as a global var


CMD:call(playerid, params)
{
    if(IsCop) return SendClientMessage(playerid, -1 , "You are a cop, why do you wanna call yourself?"); // replace IsCop with your cop variable if you want that cops cannot use this command.
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    for(new i; i>=MAX_PLAYERS;i++)
    {
        if(IsCop) //IsCop = your variable for cops and use "i" instead of playerid
        {
            format(str, sizeof(str), "%s has requested help!" pname);
            GameTextForPlayer(i, str);
            SendClientMessage(i, -1, str);
            help=1;
            helped=0;
        }
    }
    return 1;
}
CMD:answer(playerid, params)
{
    if(!IsCop) return SendClientMessage(playerid, -1 , "You not a cop."); // !IsCop = the players who are not cops, example, if your var is "PlayerInfo[playerid][cop]" then this should be "PlayerInfo[playerid][cop] == 0"
    if(helped == 1) return SendClientMessage(playerid , -1 , "Already helped!"// checking if someone already took the call
    if(help == 0) return SendClientMessage(playerid , -1 , "Nobody Called for help!"// checking if someone has actually requested for help
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
   
    for(new i; i>=MAX_PLAYERS;i++)
    {
        if(IsCop) //IsCop = your variable for cops and use "i" instead of playerid
        {
            format(str, sizeof(str), "%s has taken the call!" pname);
            SendClientMessage(i, -1, str);
            helped = 1;
            help = 0;
        }
    }
   
    return 1;
}
Reply
#4

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
something like this, not perfect, not tested may contain errors, as i made it here in this little box x:, anyways, this is just an example.
pawn Код:
new help, helped; //this will be declared as a global var


CMD:call(playerid, params)
{
    if(IsCop) return SendClientMessage(playerid, -1 , "You are a cop, why do you wanna call yourself?"); // replace IsCop with your cop variable if you want that cops cannot use this command.
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    for(new i; i>=MAX_PLAYERS;i++)
    {
        if(IsCop) //IsCop = your variable for cops and use "i" instead of playerid
        {
            format(str, sizeof(str), "%s has requested help!" pname);
            GameTextForPlayer(i, str);
            SendClientMessage(i, -1, str);
            help=1;
            helped=0;
        }
    }
    return 1;
}
CMD:answer(playerid, params)
{
    if(!IsCop) return SendClientMessage(playerid, -1 , "You not a cop."); // !IsCop = the players who are not cops, example, if your var is "PlayerInfo[playerid][cop]" then this should be "PlayerInfo[playerid][cop] == 0"
    if(helped == 1) return SendClientMessage(playerid , -1 , "Already helped!"// checking if someone already took the call
    if(help == 0) return SendClientMessage(playerid , -1 , "Nobody Called for help!"// checking if someone has actually requested for help
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
   
    for(new i; i>=MAX_PLAYERS;i++)
    {
        if(IsCop) //IsCop = your variable for cops and use "i" instead of playerid
        {
            format(str, sizeof(str), "%s has taken the call!" pname);
            SendClientMessage(i, -1, str);
            helped = 1;
            help = 0;
        }
    }
   
    return 1;
}
Thank you, i shall review it tomorrow when i wake up..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)