SA-MP Forums Archive
message problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: message problem (/showthread.php?tid=636656)



message problem - Mijata - 02.07.2017

Why only me can type in vip chat this not working for other vip players

Код:
    if(text[0] == ADMCHATKEY && pInfo[playerid][pLevel] >= 1)
	{
		format(Jstring,sizeof(Jstring),"{FFEA00}|Admin Chat| %s: %s",GetName(playerid),text[1]);
		foreach(Player, i) if(pInfo[i][pLevel] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"AdminChat");
	    return 0;
	}
Код:
	if(text[0] == DONATORCHATKEY && pInfo[playerid][pLevel] >= 1)
	{
		format(Jstring,sizeof(Jstring),"{FFEA00}|VIP Chat| %s: %s",GetName(playerid),text[1]);
		foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"VIPChatLog");
	    return 0;
	}



Re: message problem - Beryllium - 02.07.2017

Are you sure that the other players that tries to type in vip chat are "pInfo[playerid][pLevel] >= 1"?


Re: message problem - NewFreeroamStunt - 02.07.2017

It's because you use admin variable as callback [pLevel], you should use vip variable, for example: [pDonateRank]

Код:
if(text[0] == DONATORCHATKEY && pInfo[playerid][pDonateRank] >= 1)
	{
		format(Jstring,sizeof(Jstring),"{FFEA00}|VIP Chat| %s: %s",GetName(playerid),text[1]);
		foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
		WriteToLog(Jstring,"VIPChatLog");
	    return 0;
	}



Re: message problem - MrAjusshi - 02.07.2017

Try this.

pawn Код:
if(text[0] == ADMCHATKEY && pInfo[playerid][Donator] >= 1)
    {
        format(Jstring,sizeof(Jstring),"{FFEA00}|Admin Chat| %s: %s",GetName(playerid),text[1]);
        foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
        WriteToLog(Jstring,"AdminChat");
        return 0;
    }
pawn Код:
if(text[0] == DONATORCHATKEY && pInfo[playerid][Donator] >= 1)
    {
        format(Jstring,sizeof(Jstring),"{FFEA00}|VIP Chat| %s: %s",GetName(playerid),text[1]);
        foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
        WriteToLog(Jstring,"VIPChatLog");
        return 0;
    }



Re: message problem - Beryllium - 02.07.2017

Quote:
Originally Posted by MrAjusshi
Посмотреть сообщение
Try this.

pawn Код:
if(text[0] == ADMCHATKEY && pInfo[playerid][Donator] >= 1)
    {
        format(Jstring,sizeof(Jstring),"{FFEA00}|Admin Chat| %s: %s",GetName(playerid),text[1]);
        foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
        WriteToLog(Jstring,"AdminChat");
        return 0;
    }
pawn Код:
if(text[0] == DONATORCHATKEY && pInfo[playerid][Donator] >= 1)
    {
        format(Jstring,sizeof(Jstring),"{FFEA00}|VIP Chat| %s: %s",GetName(playerid),text[1]);
        foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
        WriteToLog(Jstring,"VIPChatLog");
        return 0;
    }
Are you serious guys? "pInfo[playerid][Donator]" variable does not exist in his script.

You can create a new variable with saving called "vip" or anything you want, And edit your code which is the vip chat to the new variable with saving which you created.

To get full help from me, Just post your enum and tell me which saving system you're using, Y_INI or SQLite or MySQL.


Re: message problem - MrAjusshi - 02.07.2017

Quote:
Originally Posted by Beryllium
Посмотреть сообщение
Are you serious guys? "pInfo[playerid][Donator]" variable does not exist in his script.

You can create a new variable with saving called "vip" or anything you want, And edit your code which is the vip chat to the new variable with saving which you created.

To get full help from me, Just post your enum and tell me which saving system you're using, Y_INI or SQLite or MySQL.
Код:
foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
It's exist in his script. Don't try to comment something when you are still not sure.


Re: message problem - Beryllium - 02.07.2017

Quote:
Originally Posted by MrAjusshi
Посмотреть сообщение
Код:
foreach(Player, i) if(pInfo[i][Donator] >= 1) SendClientMessage(i,Admchat,Jstring);
It's exist in his script. Don't try to comment something when you are still not sure.
I can see something interesting...

Quote:
Originally Posted by MrAjusshi
Посмотреть сообщение
Try this.

if(text[0] == ADMCHATKEY && pInfo[playerid][Donator] >= 1)
That's from your quote, Isn't it?

So can the donators access the admin chat, Good Job!