SA-MP Forums

Précédent   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Outils de la discussion Modes d'affichage
Vieux 03/09/2010, 17h07   #1
Nekrus2
Little Clucker
 
Avatar de Nekrus2
 
Date d'inscription: August 2010
Messages: 43
Reputation: 0
Par défaut RP Chat

Hey I got a script taken out of orginal server pack (gl_bubblechat)
and i was wondering how i could edit it to my use
pawn Code:
//
// Example use of chat above player's head
//

#include <a_samp>
#include "../include/gl_common.inc"

#define MESSAGE_COLOR         0xEEEEEEFF
#define ECHO_COLOR            0xEEEEEEFF
#define ACTION_COLOR          0xEE66EEFF

//------------------------------------------------

public OnFilterScriptInit()
{
    print("\n--Speech bubble example loaded.\n");
    return 1;
}

//------------------------------------------------

public OnPlayerText(playerid, text[])
{
     if(strlen(text) > 128) return 0;
     
     new to_others[MAX_CHATBUBBLE_LENGTH+1];
     new to_me[MAX_CHATBUBBLE_LENGTH+1];
     
     format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
     format(to_me,MAX_CHATBUBBLE_LENGTH,">> %s",text);
     
     SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
     SendClientMessage(playerid,ECHO_COLOR,to_me);
     
     return 0; // can't do normal chat with this loaded
}

//------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new Message[256];
    new idx;
    new actiontext[MAX_CHATBUBBLE_LENGTH+1];

    cmd = strtok(cmdtext, idx);

    // Action command
    if(strcmp("/me", cmd, true) == 0)
    {
        Message = strrest(cmdtext,idx);
        format(actiontext,MAX_CHATBUBBLE_LENGTH,"* %s",Message);
        SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,30.0,10000);
        SendClientMessage(playerid,ACTION_COLOR,actiontext);
        return 1;
    }
   
    return 0; // not handled by this script
}

//------------------------------------------------

i have given an try to edit it so it shows for everyone it area but i failed ... can anyone can show me what i need to change ?

or at least explain me what each part does ... and how i should fix it

and if you got time i will need those commands:

/r command (radio)
that you can hear it just when you got it turned on and you have got it with you

/g command (Global)
that will be global ooc chanel so everyone can talk (needs to be possibility turing it off)

/b command (ooc local chat)
works same as normal chat (ic) but its ooc and by command /b


but if you dont dont wory about them
__________________

82.19.22.175:7777
[PL].::Ultimate DeathMatch::.[PL]
Beta Tests
Nekrus2 est déconnecté  
Vieux 03/09/2010, 20h11   #2
Nekrus2
Little Clucker
 
Avatar de Nekrus2
 
Date d'inscription: August 2010
Messages: 43
Reputation: 0
Par défaut Re: RP Chat

well how to get people in area of 10 and then loop function thought them ? (message)
__________________

82.19.22.175:7777
[PL].::Ultimate DeathMatch::.[PL]
Beta Tests
Nekrus2 est déconnecté  
Vieux 03/09/2010, 20h29   #3
Voldemort
Gangsta
 
Avatar de Voldemort
 
Date d'inscription: August 2010
Messages: 592
Reputation: 26
Par défaut Re: RP Chat

try this
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new Message[256];
    new idx;
    new actiontext[MAX_CHATBUBBLE_LENGTH+1];
    cmd = strtok(cmdtext, idx);
    if(strcmp("/me", cmd, true) == 0)
    {
        Message = strrest(cmdtext,idx);
        format(actiontext,MAX_CHATBUBBLE_LENGTH,"* %s",Message);
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(IsPlayerInRangeOfPoint(i,5.0,x,y,z))
                {
                    SetPlayerChatBubble(i,actiontext,ACTION_COLOR,30.0,10000);
SendClientMessage(playerid,ACTION_COLOR,actiontext);
                }
            }
        }
        return 1;
    }

    return 0; // not handled by this script
}

I actualy dont know how ChatBubble works
__________________


Voldemort est déconnecté  
Vieux 03/09/2010, 20h45   #4
Nekrus2
Little Clucker
 
Avatar de Nekrus2
 
Date d'inscription: August 2010
Messages: 43
Reputation: 0
Par défaut Re: RP Chat

well i cant test it now because i havent got anyone to test it with ;p but i will tell you if something is wrong here after i test it
__________________

82.19.22.175:7777
[PL].::Ultimate DeathMatch::.[PL]
Beta Tests
Nekrus2 est déconnecté  
 

Outils de la discussion
Modes d'affichage

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non


Discussions similaires
Discussion Auteur Forum Réponses Dernier message
Admin Chat < Admins can't see chat or my text, but I can see their chat Andy_McKinley Help Archive 37 17/05/2011 20h26
Houw to Change [OOC chat colour and IC chat colour] help please Karl115 Help Archive 5 27/05/2010 20h39
OOC chat and Normal Chat RoneyRemington Help Archive 6 23/02/2010 02h29


Fuseau horaire GMT. Il est actuellement 00h39.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Version française #23 par l'association vBulletin francophone