Help me with this
#1

How can i script for admins that they will know that someone will join and someone will left

and how can i script that for admins only so i dont need to check always the TAB Button..
Reply
#2

Define to who this message goes like if(IsPlayerAdmin == 1) { CODE }
Reply
#3

OnPlayerConnect
pawn Код:
if(IsPlayerAdmin(playerid))
{
    new str[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(str, sizeof(str), "%s(%d) has joined the server", pname, playerid);
    SendClientMessage(playerid, -1, str);
}
same for disconnect. and if you want reason when the player disconnects
pawn Код:
switch(reason)
{
        case 0: format(str, sizeof(str), "%s(%d) has left the server (Lost Connection)", pname, playerid);
        case 1: format(str, sizeof(str), "%s(%d) has left the server (Leaving)", pname, playerid);
        case 2: format(str, sizeof(str), "%s(%d) has left the server (Kicked)", pname, playerid);
}
Reply
#4

I got one problem too, How can i disabel my Tutorial here the code:

pawn Код:
if(RegistrationStep[playerid] > 0)
    {
        if(RegistrationStep[playerid] == 1)
        {
            if (strcmp("male", text, true) == 0)
            {
                PlayerInfo[playerid][pSex] = 1;
                SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a male.");
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "What is your date of birth? (Use dd/mm/yyyy)");
                RegistrationStep[playerid] = 2;
                return 0;
            }
            else if (strcmp("female", text, true) == 0)
            {
                PlayerInfo[playerid][pSex] = 2;
                SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a female.");
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "What is your date of birth? (Use dd/mm/yyyy)");
                RegistrationStep[playerid] = 2;
                return 0;
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Are you a male or female? Type in your choice.");
            }
            return 0;
        }
        else if(RegistrationStep[playerid] == 2)
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            splits(text, DateInfo, '/');
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year)
            {
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            PlayerInfo[playerid][pAge] = check;
            PlayerInfo[playerid][pOrigin] = 0;
            format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][pAge]);
            SendClientMessageEx(playerid, COLOR_YELLOW2, string);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Thanks for filling in all the information, now you can proceed to the Tutorial!");
            RegistrationStep[playerid] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            ClearChatbox(playerid);
           
        }
        return 0;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)