Help with command
#1

Hi, I have a problem with a lot of commands. Happens that if you type for example "/slap" the command runs good, but in one part say "Unknown command", I don't know why happen that.
So, here's the command
pawn Код:
COMMAND:slap(playerid,params[])
{
    if(Informacion[playerid][Admin] >= 2)
    {
        new id;
        if(sscanf(params,"u",id))
        {
            if(Informacion[id][Idioma]==0) SendClientMessage(playerid,-1,"Usa: {FF0000}/bofetear {FFFFFF}[ID/Nombre]");
            if(Informacion[id][Idioma]==1) SendClientMessage(playerid,-1,"Use: {FF0000}/slap {FFFFFF}[ID/Name]");
            return 1;
        }
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Jugador no conectado");
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(id,X,Y,Z);
        SetPlayerPos(id,X,Y,Z+15);
        GameTextForPlayer(id,"~r~SLAP!",5000,4);
        new st[128 char];
        format(st,128,"Has bofeteado a {FF0000}%s (%d)",pNick(id),id);
        SendClientMessage(playerid,-1,st); //all is good here - the message is displayed
        PlayerPlaySound(id,1190,0.0,0.0,0.0); //HERE IS THE PROBLEM. No sound is played
    }
    return 1;
}
That happen with another command too (/are - accept report)

Sorry for the English, I'm learning.
Reply
#2

pawn Код:
else return SendClientMessage(playerid, COLOR, "You need to be level 2 to use that command!");
return 1;
Reply
#3

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
pawn Код:
else return SendClientMessage(playerid, COLOR, "You need to be level 2 to use that command!");
return 1;
still happening
Reply
#4

i do not see the problem you have return 1; all fine

pawn Код:
PlayerPlaySound(id,1190,0.0,0.0,0.0);
this is not a problem this will only play sound in slap-id. if you want to hear the sound

duplicate the PlayerPlaySound then do this

pawn Код:
PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
Reply
#5

You should try playing the player sound at the players position rather than at the middle of the map. Secondly, the unknown command error may be caused by an error in your command processor. Try using
pawn Код:
print("THISCALLED");
after PlayerPlaySound. If this is called, it's the command processor, otherwise the command seems to be skipping at that point.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)