SA-MP Forums Archive
Zcmd Question - 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: Zcmd Question (/showthread.php?tid=287906)



Zcmd Question - CSSI - 05.10.2011

What Must i Return Under These Callbacks ?

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



Re: Zcmd Question - Wesley221 - 05.10.2011

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


Re: Zcmd Question - Jafet_Macario - 05.10.2011

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


Re: Zcmd Question - CSSI - 05.10.2011

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;
}



Re: Zcmd Question - Jafet_Macario - 05.10.2011

Do you use also another command processor?


Re: Zcmd Question - Libra_PL - 05.10.2011

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;
}



Re: Zcmd Question - Max_Coldheart - 05.10.2011

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


Re: Zcmd Question - Jafet_Macario - 05.10.2011

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.


Re: Zcmd Question - CSSI - 05.10.2011

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


Re: Zcmd Question - DRIFT_HUNTER - 05.10.2011

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)