SA-MP Forums Archive
hey guyz.....i need some help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: hey guyz.....i need some help (/showthread.php?tid=284217)



hey guyz.....i need some help - _ELIX_ - 18.09.2011

this is the 1st post i have made here,,,,so here it is,,,,,

1. i need a script to see the ID of the players,,,,so if a F*cker come to ADV.....i would know his ID
rbann him
2. i need it ASAP before launching my server online
plz & thank you


Re: hey guyz.....i need some help - =WoR=Varth - 18.09.2011

You mean you want to detect player's IP?
Or you want to get playerid?
Or you want /ban command?


Re: hey guyz.....i need some help - _ELIX_ - 18.09.2011

i want to see the ID of the player

ex: ELIX(14) : test


Re: hey guyz.....i need some help - =WoR=G4M3Ov3r - 18.09.2011

ID or IP ?, you got me confused


Re: hey guyz.....i need some help - =WoR=Varth - 18.09.2011

Where? OnPlayerText? or?
You can see their ID above their head. Or press TAB.


Re: hey guyz.....i need some help - brett7 - 18.09.2011

If you want to get his id just use tab, if you want his ip here's a command using sscanf
pawn Код:
CMD:getip(playerid, params[])
{
    if(Level[playerid] < 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: you are not level 1!"); //adminvaiable here

    new str[256], id, PlayerName[MAX_PLAYER_NAME];
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /getip [id]");
        return 1;
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
    if(IsPlayerConnected(id))
    {

        GetPlayerName(id, PlayerName, sizeof(PlayerName));
        new ip[100];
        GetPlayerIp(id, ip, sizeof(ip));

        format(str, sizeof(str), "%s(%d) ip is: [%s]", PlayerName, playerid, ip);
        SendClientMessage(playerid, orange, str);



    }
    return 1;
}



Re: hey guyz.....i need some help - _ELIX_ - 18.09.2011

srry guyz,,,i mean ID

here is an example


ELIX[14] : i want to show it like that


Re: hey guyz.....i need some help - Kingunit - 18.09.2011

Replace OnPlayerText with this one:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[MAX_PLAYER_NAME], stringZ[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(stringZ,sizeof(stringZ),"%s[%d] : %s",name, playerid, text);
    SendClientMessageToAll(0xFFFFFFFF,stringZ);
   
    return 0;
}



Re: hey guyz.....i need some help - Issam - 18.09.2011

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '@')
    {
        new Pname[24], string[150];
        GetPlayerName(playerid, Pname, 24);
        format(string, sizeof(string), "|TEAM CHAT| %s(%d): %s", Pname, playerid, text[1]);
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(team[playerid] == team[i]) SendClientMessage(i, -1, string);
        }
        return 0;
    }
{
    new name[MAX_PLAYER_NAME], stringZ[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(stringZ,sizeof(stringZ),"%s[%d] : %s",name, playerid, text);
    SendClientMessageToAll(0xFFFFFFFF,stringZ);
   
    return 0;
}
    return 1;
}

Код:
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(69) : warning 217: loose indentation
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(346) : warning 217: loose indentation
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(401) : warning 217: loose indentation
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(409) : warning 225: unreachable code
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(409) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Line 410:
pawn Код:
return 1;
401:
pawn Код:
{



Re: hey guyz.....i need some help - Davz*|*Criss - 18.09.2011

Quote:
Originally Posted by Issam
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '@')
    {
        new Pname[24], string[150];
        GetPlayerName(playerid, Pname, 24);
        format(string, sizeof(string), "|TEAM CHAT| %s(%d): %s", Pname, playerid, text[1]);
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(team[playerid] == team[i]) SendClientMessage(i, -1, string);
        }
        return 0;
    }
    else
{
    new name[MAX_PLAYER_NAME], stringZ[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(stringZ,sizeof(stringZ),"%s[%d] : %s",name, playerid, text);
    SendClientMessageToAll(0xFFFFFFFF,stringZ);
   
    return 0;
}
    return 1;
}

Код:
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(69) : warning 217: loose indentation
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(346) : warning 217: loose indentation
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(410) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Line 410:
pawn Код:
return 1;
Remove the

pawn Код:
return 1;
}
And show me your lines: 346,69.

Thanks.