Problems.
#1

Hi. My problems:

1. I set player world to 1, but i don't see pickups? why? how to set pickup virtual world?

2. When player spawn i get player color and set it to variable:

Code:
SAVEPLAYERCOLOR[ playerid ] = GetPlayerColor( playerid );
But when i print variable, or color i get 0:

Code:
printf("PLAYER COLOR: %d", GetPlayerColor( playerid ) );
printf("COLOR: %d",SAVEPLAYERCOLOR[ playerid ] );
3. When player die i send death message:

Code:
SendDeathMessage(killerid, playerid, reason);
3.1. Player in other world get death message?

3.2. I write text in 0 world, but player is in 1 world, he get message?

3.3. Death message will see all players?
Reply
#2

1)
Code:
CreatePickup(model, type, X, Y, Z, virtualworld)
Just change 'virtualworld' paramter to whatever world the pickup is in. (-1 for all virtual worlds)

2)printf("PLAYER COLOR: %x", GetPlayerColor(playerid));
GetPlayerColor returns a hex value. You need to use %x as a format for hex values, not a digit (%d)

3 + 3.1) SendDeathMessage will send to all online players.
3.2) By default, the player WILL get the message.
If you only want messages to send to players in the same world, use this:
pawn Code:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    format(string,sizeof(string),"%s (%d): %s", pname, playerid, text);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid)) //Will send to only if they are in same world
            {
                SendClientMessage(i, 0xFFFFFF, string);
            }
        }
    }
    return 0;
}
3.3) Same as 3.1
Reply
#3

Thx helped. But with colors no. I print with %x i still get 0. Maybe when player spawn he get color later?
Reply
#4

How to set all objects virtual world 0 ? i have a lot of objects and it take a lot of time to add ",0". Maybe is faster way how to do it?
Reply
#5

Objects dont use virtual worlds, and for pickups their default virtual world is 0, so you dont need to put anything in your code

Also this should help you with your color problem, CLICK
Reply


Forum Jump:


Users browsing this thread: