SendClientMessage help
#1

Help me on this please

pawn Код:
// This callback gets called when a player connects to the server
public OnPlayerConnect(playerid)
{
    SendClientMessage(" Welcome to our server ");
    return 1;
    // Always allow NPC's to login without password or account
    if (IsPlayerNPC(playerid))
        return 1;

    // Setup local variables
    new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID;

    // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints
    SetPVarInt(playerid, "PVarMoney", 0);
    SetPVarInt(playerid, "PVarScore", 0);

    // Get the playername
    GetPlayerName(playerid, Name, sizeof(Name));
    // Also store this name for the player
    GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);

    // Send a message to all players to let them know somebody else joined the server
    format(NewPlayerMsg, 128, TXT_PlayerJoinedServer, Name, playerid);
    SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg);

    // Try to load the player's datafile ("PlayerFile_Load" returns "1" is the file has been read, "0" when the file cannot be read)
    if (PlayerFile_Load(playerid) == 1)
    {
        // Check if the player is still banned
        if (APlayerData[playerid][BanTime] < gettime()) // Player ban-time is passed
            ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_INPUT, TXT_DialogLoginTitle, TXT_DialogLoginMsg, TXT_DialogLoginButton1, TXT_DialogButtonCancel);
        else // Player is still banned
        {
            ShowRemainingBanTime(playerid); // Show the remaining ban-time to the player is days, hours, minutes, seconds
            Kick(playerid); // Kick the player
        }
    }
    else
        ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_INPUT, TXT_DialogRegisterTitle, TXT_DialogRegisterMsg, TXT_DialogRegisterButton1, TXT_DialogButtonCancel);

    // The houses have been loaded but not the cars, so load all vehicles assigned to the player's houses
    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
    {
        // Get the HouseID from this slot
        HouseID = APlayerData[playerid][Houses][HouseSlot];
        // Check if there is a house in this slot
        if (HouseID != 0)
            HouseFile_Load(HouseID, true); // Load the cars of the house
    }

    // Speedometer setup
    Speedometer_Setup(playerid);

    // MissionText TextDraw setup
    APlayerData[playerid][MissionText] = TextDrawCreate(320.0, 430.0, " "); // Setup the missiontext at the bottom of the screen
    TextDrawAlignment(APlayerData[playerid][MissionText], 2); // Align the missiontext to the center
    TextDrawUseBox(APlayerData[playerid][MissionText], 1); // Set the missiontext to display inside a box
    TextDrawBoxColor(APlayerData[playerid][MissionText], 0x00000066); // Set the box color of the missiontext

    // Display a message if the player hasn't accepted the rules yet
    if (APlayerData[playerid][RulesRead] == false)
        SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You haven't accepted the {FFFF00}rules{FF0000} yet . {FFFF00} Press {FF0000}/rules{FFFF00}to accept them . ");

    return 1;
}
I got 1 error

Код:
G:\The new server!!!\gamemodes\PPC_Trucking.pwn(840) : error 035: argument type mismatch (argument 1)
I need help with this line :


pawn Код:
// This callback gets called when a player connects to the server
public OnPlayerConnect(playerid)
{
    SendClientMessage(" Welcome to our server ");
    return 1;
The

pawn Код:
SendClientMessage(" Welcome to our server ");
is the line 840 witch makes the error
Reply
#2

pawn Код:
//top of script
#define green 0x00FF00AA

SendClientMessage(" Welcome to our server ");
//change it to
SendClientMessage(playerid, green, "Welcome to our server");
Reply
#3

pawn Код:
SendClientMessage(playerid , -1, "Welcome to our server");//REPLACE -1 WITH YOUR COLOR DEFINE https://sampforum.blast.hk/showthread.php?tid=157789
Got Me first :P
Reply
#4

You missed things
SendClientMessage(playerid, COLOR NAME, " Message ");

pawn Код:
SendClientMessage(playerid, 0xFFFFFFFF," Welcome to our server ");
Reply
#5

Quote:
Originally Posted by TheDeath
Посмотреть сообщение
pawn Код:
SendClientMessage(playerid , -1, "Welcome to our server");//REPLACE -1 WITH YOUR COLOR DEFINE https://sampforum.blast.hk/showthread.php?tid=157789
Got Me first :P
me 1 :P HAHA
Reply
#6

Do what Infinity90 posted.
Reply
#7

Fixed , Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)