Gamemode Roleplay Help
#1

Hi, I would like to create a gamemode roleplay, but I do not know what to use for messages users, that is, when should I write at the maximum 5/10 feet away, then I also need some advice

sorry for my bad English
Reply
#2

pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
pawn Код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                new playerworld, player2world;
                playerworld = GetPlayerVirtualWorld(playerid);
                player2world = GetPlayerVirtualWorld(i);
                if(playerworld == player2world)
                {
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
                else
                {
                    SendClientMessage(i, col1, string);
                }
            }
        }
    }
    return 1;
}
Now you can use proxdetector to see only send a message to all the players around the player. You should also change your OnPlayerText abit, something like this:

pawn Код:
OnPlayerText(playerid, text[])
{
new string[150], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string),"%s: %s", pname, text);
ProxDetector(10.0 /* or 5.0, depends what you want */, playerid, string, -1, -1, -1, -1, -1);
return 0;
}
Reply
#3

Thank you
um, do you have any advice for me? admin system which put etc.
I never created a gamemode roleplay > _>
Reply
#4

The thing is, you'll need to learn it yourself. You can find useful things on the SA-MP Wiki. I personally, never use the wiki, only to check out some parameters. I've learned PAWN by actually just experimenting with it, really. See what it does InGame when you change this, change that,... . Also I advice you to look at the tutorial section. There are numerous threads about creating an admin system.
Reply
#5

Quote:
Originally Posted by Da_Noob
Посмотреть сообщение
The thing is, you'll need to learn it yourself. You can find useful things on the SA-MP Wiki. I personally, never use the wiki, only to check out some parameters. I've learned PAWN by actually just experimenting with it, really. See what it does InGame when you change this, change that,... . Also I advice you to look at the tutorial section. There are numerous threads about creating an admin system.
ok
ehm help me ;(
I Have created a new map,started server and crash (there are 500 object) ;(
Reply
#6

If the maps Are CreateObject,
Change them to CreateDynamicObject (use Incognito's Streamer).

Btw: my server was crashing for maps, and changed the CreateObject to CreateDynamicObject and it worked.
Reply
#7

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
If the maps Are CreateObject,
Change them to CreateDynamicObject (use Incognito's Streamer).

Btw: my server was crashing for maps, and changed the CreateObject to CreateDynamicObject and it worked.
With CreateObject the limit is a 1000 with CreateDynamicObject it is unlimited so you can use CreateDynamicObject as much as you like if you go Higher then a 100 CreateObjects all of your server maps will go away and wont bell to see it unless you change it to CreateDynamicObject but also there is other ways to higher then createobject limit not to sure how but i will find out soon!!



Using the Samp wike will help you alot i am createing my own gamemode now and i might even release it cos i like doing it for fun and learning something new every day like the others do
Reply
#8

Quote:
Originally Posted by Yves
Посмотреть сообщение
With CreateObject the limit is a 1000 with CreateDynamicObject it is unlimited so you can use CreateDynamicObject as much as you like if you go Higher then a 100 CreateObjects all of your server maps will go away and wont bell to see it unless you change it to CreateDynamicObject but also there is other ways to higher then createobject limit not to sure how but i will find out soon!!



Using the Samp wike will help you alot i am createing my own gamemode now and i might even release it cos i like doing it for fun and learning something new every day like the others do
Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
If the maps Are CreateObject,
Change them to CreateDynamicObject (use Incognito's Streamer).

Btw: my server was crashing for maps, and changed the CreateObject to CreateDynamicObject and it worked.
ok Thank You
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)