SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/11/2011, 04:48 PM   #1
thimo
High-roller
 
thimo's Avatar
 
Join Date: Jan 2009
Location: Netherlands
Posts: 1,130
Reputation: 24
Default VIP chat

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!
thimo is offline   Reply With Quote
Old 25/11/2011, 04:52 PM   #2
HyperZ
High-roller
 
HyperZ's Avatar
 
Join Date: Aug 2009
Location: Islamabad, Pakistan
Posts: 1,341
Reputation: 66
Default Re: VIP chat

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;
}
__________________
HyperZ is offline   Reply With Quote
Old 25/11/2011, 06:17 PM   #3
thimo
High-roller
 
thimo's Avatar
 
Join Date: Jan 2009
Location: Netherlands
Posts: 1,130
Reputation: 24
Default Re: VIP chat

This doesnt work at all please help!?
thimo is offline   Reply With Quote
Old 25/11/2011, 06:40 PM   #4
iPLEOMAX
High-roller
 
iPLEOMAX's Avatar
 
Join Date: Mar 2011
Location: AE
Posts: 1,250
Reputation: 746
Default Re: VIP chat

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.
__________________
Goodbye SA-MP.
iPLEOMAX is offline   Reply With Quote
Old 26/11/2011, 07:33 AM   #5
thimo
High-roller
 
thimo's Avatar
 
Join Date: Jan 2009
Location: Netherlands
Posts: 1,130
Reputation: 24
Default Re: VIP chat

I already fixed myself the problem was the loop didnt go further then id 0; so i putted in continue
thimo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Shrewd Chat System V2 (With Smart Chat V3) [Good for Roleplay] =WoR=Varth Filterscripts 24 13/03/2017 12:24 PM
How to make chat and disable the Starting global chat slymatt Help Archive 1 20/07/2011 02:10 AM
Admin Chat < Admins can't see chat or my text, but I can see their chat Andy_McKinley Help Archive 37 17/05/2011 08:26 PM


All times are GMT. The time now is 06:03 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.