Zcmd Question
#1

What Must i Return Under These Callbacks ?

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
}
Reply
#2

Depends on what you wanna use inside of it.
Returning 0 in the OnCommandPerformed will stop the command from processing
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=91354
Reply
#4

My Command is not working it's not saying "Unknown Command"
pawn Код:
CMD:Slap(playerid,params[])
{
    new id;
    if(sscanf(params,"u",id)) return Msg(playerid,1,"Usage: /slap [id] ");
    else if(!IsPlayerConnected(id)) return Msg(playerid,0,"Player Not FOund");
    SetPlayerHealth(id,0.0);
    PlayerPlaySound(1149,0,0,0,0);
    return 1;
}
Reply
#5

Do you use also another command processor?
Reply
#6

Yyy?

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid,0xFFFF00FF,"Unknown command");
return 1;
}
Is that what you need?

And I'd change the command to:

Код:
CMD:Slap(playerid,params[])
{
new id;
if(!sscanf(params,"u",id))
{
if(IsPlayerConnected(id))
{
SetPlayerHealth(id,0.0);
PlayerPlaySound(id,1149,0,0,0);
}
else return Msg(playerid,0,"Player Not FOund");
}
else return Msg(playerid,1,"Usage: /slap [id] ");
return 1;
}
Reply
#7

If you're using DCMD too, ZCMD wont work.
Reply
#8

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
And I'd change the command to:

Код:
CMD:Slap(playerid,params[])
{
new id;
if(!sscanf(params,"u",id))
{
if(IsPlayerConnected(id))
{
SetPlayerHealth(id,0.0);
PlayerPlaySound(id,1149,0,0,0);
}
else return Msg(playerid,0,"Player Not FOund");
}
else return Msg(playerid,1,"Usage: /slap [id] ");
return 1;
}
It's the same thing.
Reply
#9

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
Yyy?

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid,0xFFFF00FF,"Unknown command");
return 1;
}
Is that what you need?

And I'd change the command to:

Код:
CMD:Slap(playerid,params[])
{
new id;
if(!sscanf(params,"u",id))
{
if(IsPlayerConnected(id))
{
SetPlayerHealth(id,0.0);
PlayerPlaySound(id,1149,0,0,0);
}
else return Msg(playerid,0,"Player Not FOund");
}
else return Msg(playerid,1,"Usage: /slap [id] ");
return 1;
}
It's Saying "Unknown Command" && I'm Not Using Any Other Cmds
Reply
#10

Ok these is 1000th topic with same problem

Update fucking sscanf plugin !!!
pawn Код:
CMD:Slap(playerid,params[])
{
    new id;
    if(sscanf(params,"u",id)) return Msg(playerid,1,"Usage: /slap [id] ");
    if(!IsPlayerConnected(id)) return Msg(playerid,0,"Player Not FOund");
    SetPlayerHealth(id,0.0);
    PlayerPlaySound(1149,0,0,0,0);
    return 1;
}
You dont need else there cos it will check is player not connected if sscanf fail (you dont input id or name)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)