VIP chat - 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: VIP chat (
/showthread.php?tid=299364)
VIP chat -
thimo - 25.11.2011
Well, i wanted to make a vip chat, but if i use it wont work.. what am i doing wrong in this code?
pawn Code:
if( text [ 0 ] == '!')
{
for (new i; i < MAX_PLAYERS; i++)
{
if(APlayerData[i][EtMemberShip] == 1)
{
new string[ 128 ];
GetPlayerName( playerid , string , sizeof( string ));
if(APlayerData[i][EtMemberShip] == 1)
{
format( string , sizeof( string ) , " Vip Chat: {FC0303}%s{FFFFFF}: {00CEFC}%s" , string , text[ 1 ] ) ;
SendClientMessage(i, 0xFFFFFFF , string ) ;
}
}
}
return 0 ;
Thanks!
Re: VIP chat -
HyperZ - 25.11.2011
pawn Code:
if( (text[0] == '!') && strlen(text) > 1)
{
new str[128];
new szPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
if(APlayerData[playerid][EtMemberShip] == 1)
{
format( str , sizeof( str ) , " Vip Chat: {FC0303}%s{FFFFFF}: {00CEFC}%s" , szPlayerName , text[ 1 ] ) ;
for(new iPlayerID; iPlayerID < MAX_PLAYERS; iPlayerID++)
{
if(!IsPlayerConnected(iPlayerID)) continue;
if(APlayerData[iPlayerID][EtMemberShip] == 1) continue;
SendClientMessage(iPlayerID, 0xFFFFFFF, str);
}
}
return 0;
}
Re: VIP chat -
thimo - 25.11.2011
This doesnt work at all please help!?
Re: VIP chat -
iPLEOMAX - 25.11.2011
pawn Code:
public OnPlayerText(playerid, text[])
{
if (text[0] == '!')
{
if (APlayerData[playerid][EtMemberShip] < 1)
{
SendClientMessage(playerid, -1, "Sorry, you cannot use the VIP Chat.");
return false;
}
new VIPMessage[128];
GetPlayerName(playerid, VIPMessage, MAX_PLAYER_NAME);
format(VIPMessage , sizeof VIPMessage, "VIP Chat: {FC0303}%s{FFFFFF}: {00CEFC}%s" , VIPMessage, text[1]);
for (new i; i<MAX_PLAYERS; i++)
{
if (!IsPlayerConnected(i)) continue;
if (APlayerData[i][EtMemberShip] < 1) continue;
SendClientMessage(i, -1, VIPMessage);
}
return false;
}
return true;
}
Untested.
Re: VIP chat -
thimo - 26.11.2011
I already fixed myself the problem was the loop didnt go further then id 0; so i putted in continue