Command works only for 1 player. WTF?
#1

I have a command that when player types /piss it says "Player pisses on player". When other player types piss it not says "player pisses on player" wtf? When other player types /piss, only the animation appeal, not the format message.

pawn Код:
dcmd_piss(playerid, params[]){
    #pragma unused params
    SetPlayerSpecialAction(i, SPECIAL_ACTION_PISSING);
    new Float: POS[3];
    new player1, playername[MAX_PLAYER_NAME], pissername[MAX_PLAYER_NAME];
    GetPlayerPos(player1, POS[0], POS[1], POS[2]);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid){
       if(IsPlayerInRange(player1, 2, 2, POS[0], POS[1], POS[2])){
          GetPlayerName(player1, playername, sizeof(playername));
          GetPlayerName(playerid,pissername,sizeof(pissername));
          new stringS[100];
          format(stringS,sizeof(stringS),"* %s pisses on %s.",pissername,playername);
          SendClientMessageToAll(COLOR_PINK, stringS);
       }
    }
    return 1;
}
Reply
#2

Show the hole command.. that's just a part.
Reply
#3

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Show the hole command.. that's just a part.
pawn Код:
dcmd_piss(playerid, params[]){
    #pragma unused params
    SetPlayerSpecialAction(i, SPECIAL_ACTION_PISSING);
    new Float: POS[3];
    new player1, playername[MAX_PLAYER_NAME], pissername[MAX_PLAYER_NAME];
    GetPlayerPos(player1, POS[0], POS[1], POS[2]);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid){
       if(IsPlayerInRange(player1, 2, 2, POS[0], POS[1], POS[2])){
          GetPlayerName(player1, playername, sizeof(playername));
          GetPlayerName(playerid,pissername,sizeof(pissername));
          new stringS[100];
          format(stringS,sizeof(stringS),"* %s pisses on %s.",pissername,playername);
          SendClientMessageToAll(COLOR, stringS);
       }
    }
    return 1;
}
Reply
#4

bump. Will someone help me to fix this cmd?
Reply
#5

pawn Код:
dcmd_piss(playerid, params[])
{
    #pragma unused params
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_PISSING);
    new playername[MAX_PLAYER_NAME], pissername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pissername,sizeof(pissername));
    new stringS[100];
    new Float: POS[3];
    GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && i != playerid)
        {
            if(IsPlayerInRange(i, 2, 2, POS[0], POS[1], POS[2]))
            {
                GetPlayerName(i, playername, sizeof(playername));
                format(stringS,sizeof(stringS),"* %s pisses on %s.",pissername,playername);
                SendClientMessageToAll(COLOR_PINK, stringS);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)