How to script this.
#1

Hello i just want to know how to script that a player had Joined my server and it looks like this:

Eljay Mizanin had Joined MGRP

Like that.
Reply
#2

Hello,

What script are you using?
Reply
#3

https://sampwiki.blast.hk/wiki/Creating_...Leave_Messages
Reply
#4

pawn Код:
case 2:
        {
            format(string, sizeof(string), "%s has left the server (kicked/banned).", GetPlayerNameEx(playerid));
            ProxDetector(999999.99999, playerid, string, COLOR_TWAQUA,COLOR_TWAQUA,COLOR_TWAQUA,COLOR_TWAQUA,COLOR_TWAQUA);
        }
    }
this is my script when players left
Reply
#5

pawn Код:
public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has joined the server", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
Thats from the tutorial, you need to customize it for your script.
Reply
#6

pawn Код:
public OnPlayerConnect(playerid)
{
    // Crash Fix - GhoulSlayeR
    InvalidNameCheck(playerid);

    new playerIP[16];
    GetPlayerIp(playerid, playerIP, sizeof(playerIP));
    if (CheckBan(playerIP) == 1)
    {
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_RED, "SERVER: You are banned from this server.");
        Kick(playerid);
        return 1;
    }
    if(IsPlayerNPC(playerid)) return 1;
    TotalConnect++;
    PlayersConnected++;
    if(PlayersConnected > MaxPlayersConnected)
    {
        MaxPlayersConnected = PlayersConnected;
        gettime(MPHour,MPMinute);
        getdate(MPYear,MPMonth,MPDay);
    }
But this my my style if there's a player will join.
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    // Crash Fix - GhoulSlayeR
    InvalidNameCheck(playerid);

    new playerIP[16];
    GetPlayerIp(playerid, playerIP, sizeof(playerIP));
    if (CheckBan(playerIP) == 1)
    {
 new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has joined the server", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
     }
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_RED, "SERVER: You are banned from this server.");
        Kick(playerid);
        return 1;
    }
    if(IsPlayerNPC(playerid)) return 1;
    TotalConnect++;
    PlayersConnected++;
    if(PlayersConnected > MaxPlayersConnected)
    {
        MaxPlayersConnected = PlayersConnected;
        gettime(MPHour,MPMinute);
        getdate(MPYear,MPMonth,MPDay);
    }
Try that
Reply
#8

This will come out

pawn Код:
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2908) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2908) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2915) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2915) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2922) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2922) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2931) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2931) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2937) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2937) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2945) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2945) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2952) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2952) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2959) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2959) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2966) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2966) : warning 202: number of arguments does not match definition
C:\DOCUME~1\DWINLI~1\Desktop\RG-RP@~1\GAMEMO~1\NGRP.pwn(2977) : warning 202: number of arguments does not match definition
Reply
#9

Hello,

Do you have skype? Add me danieldavis95 for extra support.
Reply
#10

Something like this I guess?

pawn Код:
public OnPlayerConnect(playerid)
{  
    //New string variable for join message:
    new szJoinMessage[128];
   
    //New string variable for player name:
    new szPlayerName[24];
   
    //Get the player's name:
    GetPlayerName( playerid, szPlayerName, sizeof szPlayerName );
   
    //Format it into dest string, the join message:
    format( szJoinMessage, sizeof szJoinMessage, "{FFFFFF}%s has joined MGRP.", szPlayerName );
   
    //Send formatted string to all players.
    SendClientMessageToAll( -1, szJoinMessage );
    return 1;
}
Compiles fine.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)