stock CheckAnim(playerid)
{
if(TheAnim[playerid] == 0) return 0;
if(TheAnim[playerid] == 1) return 1;
return 0;
}
stock DoAnim(playerid, namecmd[])
{
TheAnim[playerid] = 1;
return cmd_namecmd[](playerid, params);
}
CMD:test(playerid, params[])
{
if(CheckAnim(playerid) == 0)
{
DoAnim(playerid, "test");
return 1;
}
SendClientMessageEx(playerid, -1, "Success.");
return 1;
}
stock CheckAnim(playerid)
{
if(TheAnim[playerid] == 0) return 0;
if(TheAnim[playerid] == 1) return 1;
}
CMD:test(playerid, params[])
{
if(CheckAnim(playerid) == 0)
{
TheAnim[playerid] = 1;
}
SendClientMessageEx(playerid, -1, "Success.");
return 1;
}
I think I understand what you're trying to achieve but why are you? Also use PAWN tags rather than quote's as it's hard to see without indentation. Also in future when trying to see if something works or not... Why not actually try it?
|
isn't that easier ? or do you want to repeat the command? |
stock Test(playerid)
{
if(TheAnim[playerid] == 0)
{
TheAnim[playerid] = 1;
Test(playerid);
} else {
SendClientMessageEx(playerid, -1, "Success.");
}
return 1;
}
CMD:test(playerid, params[])
{
Test(playerid);
return 1;
}
CMD:greet(playerid,params[])
{
SendClientMessage(playerid,-1,"Hello ,How are you ?");
return 1;
}
stock greeting()
{
return cmd_greet; //It should be "cmd_(command name here)" if you are using <zcmd>
}