Jump to content
  • 0

Ajutor comanda /premiumchat


Extremys

Question

Problema intalnita (descriere):Am incercat sa fac chatul /pc pentru cei cu cont premium dar vreau sa vada si admini ce scriu ei acolo, din ce am testat eu admin nu vad daca ei scriu iar cate odata se incurca gold cu silver, la compilare nu da eroare sau warning
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):

 

Spoiler

if(strcmp(cmd, "/premiumchat", true) == 0 || strcmp(cmd, "/pc", true) == 0)


    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            result[0] = toupper(result[0]);
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_SERVER, "USAGE:{FFFFFF} (/pc) [premium chat]");
                return 1;
            }
            new prank[156];
            if(PlayerInfo[playerid][pPremium] == 1) prank = "[/pc]Silver";
            else if(PlayerInfo[playerid][pPremium] == 2) prank = "[/pc]Gold";
            else if(PlayerInfo[playerid][pAdmin] >= 1 prank = "[/pc]Admin";

            
            

            format(string, sizeof(string), "{FF0000}%s {006699}%s: {FFFFFF}%s", prank, sendername, result);
            PlayerInfo[playerid][pPremium] = 1;
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                SendPremiumMessage(0xE09243FF, string);
            }
            printf("{/pc} %s: %s", sendername, result);
        }
        return 1;

 

Imagini / Video (optional):
Ati incercat sa rezolvati singur?:Da

Edited by Extremys

giphy.gif

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
        
Foloseste asa: Si in loc de SendAdmins bagi functia cu care se trimite la tine pe GM mesaje admnilor.

format(string, sizeof(string), "{FF0000}%s {006699}%s: {FFFFFF}%s", prank, sendername, result);
SendPremiumMessage(0xE09243FF, string);
PlayerInfo[playerid][pPremium] = 1;
if (PlayerInfo[playerid][pAdmin] >= 1)
  {
       SendAdmins(0xE09243FF, string);
  }
  printf("{/pc} %s: %s", sendername, result);
}

 

Link to comment
Share on other sites

  • 0
Acum 29 minute, S1meD a spus:

        
Foloseste asa: Si in loc de SendAdmins bagi functia cu care se trimite la tine pe GM mesaje admnilor.

format(string, sizeof(string), "{FF0000}%s {006699}%s: {FFFFFF}%s", prank, sendername, result);
SendPremiumMessage(0xE09243FF, string);
PlayerInfo[playerid][pPremium] = 1;
if (PlayerInfo[playerid][pAdmin] >= 1)
  {
       SendAdmins(0xE09243FF, string);
  }
  printf("{/pc} %s: %s", sendername, result);
}

 

Acum mi se incurca silver/gold intre ele iar cateodata nici nu se vede mesaju trimis

giphy.gif

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.