kname,playerid?
#1

Well yes I want to do when the guy uses animation to defend them in chat

Lucian (2) Pisses On NaB(0)

and do not know how to do so and I see it's just as IDs and names as

I did so at first order

Quote:

new kName[ MAX_PLAYER_NAME ], string[ 256 ];
GetPlayerName(playerid, kName, sizeof(kName));

on command

Quote:

if(strcmp(cmd, "/piss", true) == 0)
{
SetPlayerSpecialAction(playerid, 6; // not defined in a_players.inc, so it's just the ID.
format(string, sizeof(string), "%s (%d) Pisses On %s(%d)", kName,playerid);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}

that's only occur when the same id and name
and I tried it but will not work

Quote:

if(strcmp(cmd, "/piss", true) == 0)
{
SetPlayerSpecialAction(playerid, 6; // not defined in a_players.inc, so it's just the ID.
format(string, sizeof(string), "%s (%d) Pisses On %s(%d)", kName,playerid),kname,playerid;
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}

and it compiles but I kept my id name if I could do when no one beside me to defend him just grind and grind when someone like him can do
Reply
#2

Like this? Untested and didn't compiled it yet...

pawn Код:
if ( !strcmp( cmdtext, "/piss", true ) )
{
    new iTarget;

    SetPlayerSpecialAction( playerid, 6 );

    new Float: iPos[ 3 ];

    GetPlayerPos( playerid, iPos[ 0 ], iPos[ 1 ], iPos[ 2 ] );

    // IMPORTANT: I use foreach.

    foreach (Player, i )
    {
         if( IsPlayerInRangeOfPoint( i, 2.0, iPos[ 0 ], iPos[ 1 ], iPos[ 2 ] ) )
         {
              iTarget = i;
         }
    }

    new iName[ 24 ];

    GetPlayerName( iTarget, iName, sizeof iName );

    new kName[ 24 ];

    GetPlayerName( playerid, kName, sizeof kName );

    new szString[ 128 ];

    format( szString, sizeof szString, "%s ( %d ) pisses on %s ( %d )",  kName, playerid, iName, iTarget );

    SendClientMessageToAll( 0xFFFFFFAA, szString );

    return 1;
}
Reply
#3

Код:
D:\G@MES (Lucian™)\GTA San Andreas\LS Gang War\filterscripts\actions.pwn(213) : error 017: undefined symbol "stcmp"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Change stcmp to strcmp. Fixed!
Reply
#5

Quote:
Originally Posted by Basicz
Посмотреть сообщение
Change stcmp to strcmp. Fixed!
th'x is work
but i have one a question
home can change
ok
i use /piss and said
Lucian (o) pissed on Lucian (0)

how can if there's no one beside me
how can change Lucian (0) Pisses. (this is for no on some one)
and for some one guy Lucian (0) pisses on Nab(1)

Can help me plz
Reply
#6

Change this:
pawn Код:
foreach (Player, i )
    {
         if( IsPlayerInRangeOfPoint( i, 2.0, iPos[ 0 ], iPos[ 1 ], iPos[ 2 ] ) )
         {
              iTarget = i;
         }
    }
To this:
pawn Код:
foreach (Player, i )
    {
         if( IsPlayerInRangeOfPoint( i, 2.0, iPos[ 0 ], iPos[ 1 ], iPos[ 2 ] ) && playerid != i )
         {
              iTarget = i;
         }
    }
Edit: Didn't see the rest of your request, try this:
pawn Код:
if(!strcmp(cmdtext, "/piss", true))
{
    new
        iTarget;

    new
        Float:iPos[3];

    GetPlayerPos(playerid, iPos[0], iPos[1], iPos[2]);
   
    new
        pName[MAX_PLAYER_NAME],
        iTargetName[MAX_PLAYER_NAME],
        iStr[75];

    GetPlayerName(playerid, pName, sizeof(pName));
   
    foreach(Player, i)
    {
        if(IsPlayerInRangeOfPoint(i, 2.0, iPos[0], iPos[1], iPos[2]) && playerid != i)
        {
            iTarget = i;

            GetPlayerName(iTarget, iTargetName, sizeof(iTargetName));
            format(iStr, sizeof(iStr), "%s(%d) pisses on %s(%d)", pName, playerid, iTargetName, iTarget);
        }
        else format(iStr, sizeof(iStr), "%s(%d) pisses.", pName, playerid);
    }
    return SetPlayerSpecialAction(playerid, 6), SendClientMessageToAll(-1, iStr);
}
Reply
#7

Didn't see Lethal's post! Use his script, that's more quicker than mine!
Reply
#8

Quote:
Originally Posted by ...:Lucian:...
Посмотреть сообщение
th'x is work
but i have one a question
home can change
ok
i use /piss and said
Lucian (o) pissed on Lucian (0)

how can if there's no one beside me
how can change Lucian (0) Pisses. (this is for no on some one)
and for some one guy Lucian (0) pisses on Nab(1)

Can help me plz
can help me with this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)