VIP chat help... how to make it so ... [Readdd] -
English-Conceptz - 01.12.2011
fixed dont reply
Re: VIP chat help... how to make it so ... [Readdd] -
[MG]Dimi - 01.12.2011
pawn Код:
CMD:vip(playerid, params[])
{
new string[128],name[24];
if (gPlayerData[playerid][VIP] < 1) return SendClientMessage(playerid, -1, "Sorry, you cannot use the this Chat. Please Donate first.");
if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error. Correct usage: /vip [text]");
GetPlayerName(playerid,name,24);
format( string, sizeof( string ),"V.I.P Chat: {00FF00}%s(%d){FF5500}: %s",name playerid,params);
for(new a=0;a<MAX_PLAYERS;a++) if(IsPlayerConnected(a) && gPlayerData[playerid][VIP] >= 1) SendClientMessage(a,-1,string);
return 1;
}
UNTESTED!
Re: VIP chat help... how to make it so ... [Readdd] -
admantis - 01.12.2011
Dimi's command did the job, but it did not work like the first one, maybe it was even re-written, you feel free to use my version (which is also flawless).
pawn Код:
CMD:vip( playerid, params[ ] )
{
if (gPlayerData[playerid][VIP] >= 1)
{
new string[128];
if( isnull( params ) ) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error. Correct usage: /vip [text]");
format( string, sizeof( string ),"V.I.P Chat: {00FF00}%s{FF5500}: %s", playerid, pText );
foreach(Player,i) // for(new i = 0; i < MAX_PLAYERS; i++)
{
if ( gPlayerData[i][VIP] >= 1 )
{
SendclientMessage( i , -1, string );
}
}
}
else if (gPlayerData[playerid][VIP] < 1)
{
SendClientMessage(playerid, -1, "Sorry, you cannot use the this Chat. Please Donate first.");
return 1;
}
return 1;
}
Re: VIP chat help... how to make it so ... [Readdd] -
English-Conceptz - 01.12.2011
just pm'd you but your command also have some errors in, ive fixed some but others idk,
SAMP\filterscripts\EcRegisterLogin.pwn(722) : error 017: undefined symbol "foreach"
foreach(Player,i) // for(new i = 0; i < MAX_PLAYERS; i++)
SAMP\filterscripts\EcRegisterLogin.pwn(724) : error 017: undefined symbol "i"
if ( gPlayerData[i][VIP] >= 1 )
SAMP\filterscripts\EcRegisterLogin.pwn(726) : error 017: undefined symbol "SendclientMessage"
SendclientMessage( i , -1, string );
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Re: VIP chat help... how to make it so ... [Readdd] -
Thresholdold - 01.12.2011
Do you have the 'Foreach' included?
Error: Undefined Symbol - SendclientMessage
Error: Undefined Symbol - i
Change: SendclientMessage
to: SendClientMessage
Re: VIP chat help... how to make it so ... [Readdd] -
Kostas' - 01.12.2011
SAMP\filterscripts\EcRegisterLogin.pwn(722) : error 017: undefined symbol "foreach"
pawn Код:
// At The Top
#include <foreach>
Edit: User above was faster.
Re: VIP chat help... how to make it so ... [Readdd] -
AstonDA-G - 01.12.2011
If you dont have Foreach, Use admantis's cmd with the loop instead of foreach,which is a seperate include.
Код:
CMD:vip( playerid, params[ ] )
{
if (gPlayerData[playerid][VIP] >= 1)
{
new string[128];
if( isnull( params ) ) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error. Correct usage: /vip [text]");
format( string, sizeof( string ),"V.I.P Chat: {00FF00}%s{FF5500}: %s", playerid, pText );
for(new i = 0; i < MAX_PLAYERS; i++)
{
if ( gPlayerData[i][VIP] >= 1 )
{
SendClientMessage( i , -1, string );
}
}
}
else if (gPlayerData[playerid][VIP] < 1)
{
SendClientMessage(playerid, -1, "Sorry, you cannot use the this Chat. Please Donate first.");
return 1;
}
return 1;
}
Im pretty sure that should work
Re: VIP chat help... how to make it so ... [Readdd] -
admantis - 01.12.2011
I'm sorry about the SendclientMessage it's capitalization mistake..
Use:
Код:
SendClientMessage( i , -1, string );
Re: VIP chat help... how to make it so ... [Readdd] -
Thresholdold - 01.12.2011
EDIT: This wasn't meant to be posted :S It was meant to be my signature :O
Re: VIP chat help... how to make it so ... [Readdd] -
English-Conceptz - 01.12.2011
ok i fixed the errors but when i type in the vip chat like for example:
/vip testing if this works
nothing will show up after "V.I.P Chat:"
??
EDIT: this is the current code :
PHP код:
CMD:vip( playerid, params[ ] )
{
if (gPlayerData[playerid][VIP] >= 1)
{
new string[128], pText[128];
if( isnull( params ) ) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error. Correct usage: /vip [text]");
format( string, sizeof( string ),"V.I.P Chat: {00FF00}%s{FF5500}: %s", playerid, pText );
foreach(Player,i) // for(new i = 0; i < MAX_PLAYERS; i++)
{
if ( gPlayerData[i][VIP] >= 1 )
{
SendClientMessage ( i , -1, string );
}
}
}
else if (gPlayerData[playerid][VIP] < 1)
{
SendClientMessage(playerid, -1, "Sorry, you cannot use the this Chat. Please Donate first.");
return 1;
}
return 1;
}