SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 25/08/2012, 12:04 PM   #1
budelis
Huge Clucker
 
Join Date: Jun 2011
Posts: 453
Reputation: 7
Default Problems.

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?
budelis is offline   Reply With Quote
Old 25/08/2012, 12:14 PM   #2
clarencecuzz
Gangsta
 
Join Date: Jul 2010
Location: Australia
Posts: 928
Reputation: 92
Default Re: Problems.

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
clarencecuzz is offline   Reply With Quote
Old 25/08/2012, 01:29 PM   #3
budelis
Huge Clucker
 
Join Date: Jun 2011
Posts: 453
Reputation: 7
Default Re: Problems.

Thx helped. But with colors no. I print with %x i still get 0. Maybe when player spawn he get color later?
budelis is offline   Reply With Quote
Old 25/08/2012, 02:17 PM   #4
budelis
Huge Clucker
 
Join Date: Jun 2011
Posts: 453
Reputation: 7
Default Re: Problems.

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?
budelis is offline   Reply With Quote
Old 25/08/2012, 02:39 PM   #5
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 2,852
Reputation: 675
Default AW: Problems.

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
Nero_3D 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
Some problems. Gh0sT_ Help Archive 19 31/07/2011 06:55 PM
problems??? selten98 Help Archive 7 16/06/2010 12:43 PM
/pm problems Rhemsis Help Archive 9 16/11/2009 05:44 PM
[FS]CarOwnership problems, GM Problems coole210 Help Archive 8 17/06/2009 09:27 PM


All times are GMT. The time now is 07:44 AM.


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