Help ZCMD
#1

Код:
	if(challenge[playerid] == 0 || PlayerDualWatching[playerid] == 0 || InDual[playerid] == 0)
	{


    cmd_watchduels(playerid,params);
    cmd_duel(playerid,params);
    cmd_acceptduel(playerid,params);
    cmd_declineduel(playerid,params);
	cmd_gm(playerid,params);
	cmd_grc(playerid,params);
	cmd_gri(playerid,params);
	cmd_grj(playerid,params);
	cmd_grk(playerid,params);
	cmd_grl(playerid,params);
	cmd_grlead(playerid,params);
	cmd_grlist(playerid,params);
	cmd_groupcreate(playerid,params);
	cmd_groupinvite(playerid,params);
	cmd_groupjoin(playerid,params);
	cmd_groupkick(playerid,params);
	cmd_groupleader(playerid,params);
	cmd_groupleave(playerid,params);
	cmd_grouplist(playerid,params);
	cmd_groupmessage, 12, (playerid,params);
	cmd_groups(playerid,params);
    cmd_a(playerid,params);
    cmd_ws(playerid,params);
    cmd_ra(playerid,params);
    cmd_fl(playerid,params);
    cmd_accountdisable(playerid,params);
    cmd_admins(playerid,params);
    cmd_aduty(playerid,params);
    //cmd_antispam(playerid,params);
    cmd_announce(playerid,params);
    cmd_count(playerid,params);
    cmd_aveh(playerid,params);
    cmd_ban(playerid,params);
    cmd_complain(playerid,params);
    cmd_freeze(playerid,params);
    cmd_unfreeze(playerid,params);
    cmd_get(playerid,params);
    cmd_givecash(playerid,params);
    cmd_agoto(playerid,params);
    cmd_hog(playerid,params);
    cmd_kick(playerid,params);
    cmd_makemegodadmin(playerid,params);
    cmd_mute(playerid,params);
    cmd_skinmenu(playerid,params);
    //cmd_score(playerid,params);
    cmd_setdeaths(playerid,params);
    cmd_setkills(playerid,params);
    cmd_setlevel(playerid,params);
    cmd_setscore(playerid,params);
    cmd_setviplevel(playerid,params);
    cmd_slap(playerid,params);
    cmd_stats(playerid,params);
    cmd_unfreeze(playerid,params);
    cmd_unmute(playerid,params);
    cmd_vips(playerid,params);
    cmd_warn(playerid,params);
    cmd_destroycar(playerid,params);
    cmd_veh(playerid,params);
    cmd_giveveh(playerid,params);
    cmd_spec(playerid,params);
    cmd_accountinfo(playerid,params);
    cmd_aweapons(playerid,params);
    cmd_afix(playerid,params);
    cmd_anos(playerid,params);
    cmd_register(playerid,params);
    cmd_wave(playerid,params);
    cmd_foff(playerid,params);
    cmd_fart(playerid,params);
    cmd_gas(playerid,params);
    cmd_flash(playerid,params);
    //cmd_fart(playerid,params);
    cmd_cry(playerid,params);
    cmd_wank(playerid,params);
    cmd_jumpkick(playerid,params);
    cmd_ad(playerid,params);
    cmd_buyad(playerid,params);
    cmd_cage(playerid,params);

    cmd_mycarid(playerid,params);
    cmd_attachobject(playerid,params);
    cmd_dobject(playerid,params);
    cmd_skin(playerid,params);
    cmd_myskin(playerid,params);
    cmd_saveskin(playerid,params);
    cmd_pm(playerid,params);
    cmd_whisper(playerid,params);
    cmd_w(playerid,params);
    cmd_ms(playerid,params);
    cmd_m(playerid,params);
    cmd_r(playerid,params);
    cmd_carcolour(playerid,params);
    cmd_reply(playerid,params);
    cmd_nopm(playerid,params);
    cmd_bug(playerid,params);
    cmd_td(playerid,params);
    cmd_takedrugs(playerid,params);
	cmd_buydrugs(playerid,params);
	cmd_help(playerid,params);
	cmd_rape(playerid,params);
	cmd_gotomb(playerid,params);
	cmd_weapons(playerid,params);
	cmd_tele(playerid,params);
	cmd_teleport(playerid,params);
    cmd_ohelp(playerid,params);
    cmd_addobject(playerid,params);
    cmd_editobject(playerid,params);
    cmd_deleteobject, 12, (playerid,params);
    cmd_canceledit(playerid,params);
    cmd_gotoobject(playerid,params);
    cmd_deleteall(playerid,params);
    cmd_moneyrush(playerid,params);
    cmd_mr(playerid,params);
    cmd_startmr(playerid,params);
    cmd_startmoneyrush, 14, (playerid,params);
    cmd_test(playerid,params);
    cmd_ann(playerid,params);
    cmd_fix(playerid,params);
    cmd_sh(playerid,params);
    cmd_sar(playerid,params);
    cmd_goto(playerid,params);
    cmd_tournament(playerid,params);
    cmd_blockfix(playerid,params);
    cmd_blocksh(playerid,params);
    cmd_blocksar(playerid,params);
    cmd_blockgoto(playerid,params);
    cmd_disablegoto(playerid,params);
    cmd_aka(playerid,params);
    cmd_ej(playerid,params);
    cmd_ejm(playerid,params);
    cmd_eject(playerid,params);
    cmd_ejectme(playerid,params);
    cmd_rules(playerid,params);
    cmd_settings(playerid,params);
    cmd_inventory(playerid,params);
    cmd_inv(playerid,params);
	cmd_aflip(playerid,params);
	cmd_atune(playerid,params);
	cmd_team(playerid,params);
	cmd_cmds(playerid,params);
	cmd_acmds(playerid,params);
	cmd_sit(playerid,params);
	cmd_bs(playerid,params);
	cmd_challenge(playerid,params);
	cmd_chinawars(playerid,params);
	cmd_d(playerid,params);
	cmd_dance(playerid,params);
	cmd_kill(playerid,params);
	//cmd_leave(playerid,params);
	cmd_ls(playerid,params);
	cmd_santa(playerid,params);
	cmd_sfa(playerid,params);
	cmd_me(playerid,params);

    cmd_dapo(playerid,params);
    cmd_apo(playerid,params);

	cmd_blockrape(playerid,params);

    cmd_timetest(playerid,params);
	}
	else
	{
	   if(InDual[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Command While In Duel.");
	   }
	   if(challange[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Any Command In Challenge - Use /leave");
	   }
	   else
	   {
	   SCM(playerid,COLOR_RED,"You Can't Use This Command While Watching Duels - Use /leavewatch");
	   }
	}
When i try this it say command already defined
i can't add this in each and every command
Код:
if(InDual[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Command While In Duel.");
	   }
	   if(challange[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Any Command In Challenge - Use /leave");
	   }
and i am adding this where my commands end
after my last command
Reply
#2

you can check first in OnPlayerCommandText() and if allowed then proceed with the cmd.

another way is to put it into a function so you don't have to copy it and then just break the code with "return" if they don't match the variables you want.
Reply
#3

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
you can check first in OnPlayerCommandText() and if allowed then proceed with the cmd.

another way is to put it into a function so you don't have to copy it and then just break the code with "return" if they don't match the variables you want.
tried onplayercommandtext()
Код:
public OnPlayerOnPlayerCommandText()
{
//---might work---//
	if(challenge[playerid] == 0 || PlayerDualWatching[playerid] == 0 || InDual[playerid] == 0)
	{


    cmd_watchduels(playerid,params),
    cmd_duel(playerid,params),
    cmd_acceptduel(playerid,params),
    cmd_declineduel(playerid,params),
	cmd_gm(playerid,params),
	cmd_grc(playerid,params),
	cmd_gri(playerid,params),
	cmd_grj(playerid,params),
	cmd_grk(playerid,params),
	cmd_grl(playerid,params),
	cmd_grlead(playerid,params),
	cmd_grlist(playerid,params),
	cmd_groupcreate(playerid,params),
	cmd_groupinvite(playerid,params),
	cmd_groupjoin(playerid,params),
	cmd_groupkick(playerid,params),
	cmd_groupleader(playerid,params),
	cmd_groupleave(playerid,params),
	cmd_grouplist(playerid,params),
	cmd_groupmessage, 12, (playerid,params),
	cmd_groups(playerid,params),
    cmd_a(playerid,params),
    cmd_ws(playerid,params),
    cmd_ra(playerid,params),
    cmd_fl(playerid,params),
    cmd_accountdisable(playerid,params),
    cmd_admins(playerid,params),
    cmd_aduty(playerid,params),
    //cmd_antispam(playerid,params),
    cmd_announce(playerid,params),
    cmd_count(playerid,params),
    cmd_aveh(playerid,params),
    cmd_ban(playerid,params),
    cmd_complain(playerid,params),
    cmd_freeze(playerid,params),
    cmd_unfreeze(playerid,params),
    cmd_get(playerid,params),
    cmd_givecash(playerid,params),
    cmd_agoto(playerid,params),
    cmd_hog(playerid,params),
    cmd_kick(playerid,params),
    cmd_makemegodadmin(playerid,params),
    cmd_mute(playerid,params),
    cmd_skinmenu(playerid,params),
    //cmd_score(playerid,params),
    cmd_setdeaths(playerid,params),
    cmd_setkills(playerid,params),
    cmd_setlevel(playerid,params),
    cmd_setscore(playerid,params),
    cmd_setviplevel(playerid,params),
    cmd_slap(playerid,params),
    cmd_stats(playerid,params),
    cmd_unfreeze(playerid,params),
    cmd_unmute(playerid,params),
    cmd_vips(playerid,params),
    cmd_warn(playerid,params),
    cmd_destroycar(playerid,params),
    cmd_veh(playerid,params),
    cmd_giveveh(playerid,params),
    cmd_spec(playerid,params),
    cmd_accountinfo(playerid,params),
    cmd_aweapons(playerid,params),
    cmd_afix(playerid,params),
    cmd_anos(playerid,params),
    cmd_register(playerid,params),
    cmd_wave(playerid,params),
    cmd_foff(playerid,params),
    cmd_fart(playerid,params),
    cmd_gas(playerid,params),
    cmd_flash(playerid,params),
    //cmd_fart(playerid,params),
    cmd_cry(playerid,params),
    cmd_wank(playerid,params),
    cmd_jumpkick(playerid,params),
    cmd_ad(playerid,params),
    cmd_buyad(playerid,params),
    cmd_cage(playerid,params),

    cmd_mycarid(playerid,params),
    cmd_attachobject(playerid,params),
    cmd_dobject(playerid,params),
    cmd_skin(playerid,params),
    cmd_myskin(playerid,params),
    cmd_saveskin(playerid,params),
    cmd_pm(playerid,params),
    cmd_whisper(playerid,params),
    cmd_w(playerid,params),
    cmd_ms(playerid,params),
    cmd_m(playerid,params),
    cmd_r(playerid,params),
    cmd_carcolour(playerid,params),
    cmd_reply(playerid,params),
    cmd_nopm(playerid,params),
    cmd_bug(playerid,params),
    cmd_td(playerid,params),
    cmd_takedrugs(playerid,params),
	cmd_buydrugs(playerid,params),
	cmd_help(playerid,params),
	cmd_rape(playerid,params),
	cmd_gotomb(playerid,params),
	cmd_weapons(playerid,params),
	cmd_tele(playerid,params),
	cmd_teleport(playerid,params),
    cmd_ohelp(playerid,params),
    cmd_addobject(playerid,params),
    cmd_editobject(playerid,params),
    cmd_deleteobject, 12, (playerid,params),
    cmd_canceledit(playerid,params),
    cmd_gotoobject(playerid,params),
    cmd_deleteall(playerid,params),
    cmd_moneyrush(playerid,params),
    cmd_mr(playerid,params),
    cmd_startmr(playerid,params),
    cmd_startmoneyrush, 14, (playerid,params),
    cmd_test(playerid,params),
    cmd_ann(playerid,params),
    cmd_fix(playerid,params),
    cmd_sh(playerid,params),
    cmd_sar(playerid,params),
    cmd_goto(playerid,params),
    cmd_tournament(playerid,params),
    cmd_blockfix(playerid,params),
    cmd_blocksh(playerid,params),
    cmd_blocksar(playerid,params),
    cmd_blockgoto(playerid,params),
    cmd_disablegoto(playerid,params),
    cmd_aka(playerid,params),
    cmd_ej(playerid,params),
    cmd_ejm(playerid,params),
    cmd_eject(playerid,params),
    cmd_ejectme(playerid,params),
    cmd_rules(playerid,params),
    cmd_settings(playerid,params),
    cmd_inventory(playerid,params),
    cmd_inv(playerid,params),
	cmd_aflip(playerid,params),
	cmd_atune(playerid,params),
	cmd_team(playerid,params),
	cmd_cmds(playerid,params),
	cmd_acmds(playerid,params),
	cmd_sit(playerid,params),
	cmd_bs(playerid,params),
	cmd_challenge(playerid,params),
	cmd_chinawars(playerid,params),
	cmd_d(playerid,params),
	cmd_dance(playerid,params),
	cmd_kill(playerid,params),
	//cmd_leave(playerid,params),
	cmd_ls(playerid,params),
	cmd_santa(playerid,params),
	cmd_sfa(playerid,params),
	cmd_me(playerid,params),

    cmd_dapo(playerid,params),
    cmd_apo(playerid,params),

	cmd_blockrape(playerid,params),

    cmd_timetest(playerid,params)
	}
	else
	{
	   if(InDual[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Command While In Duel.");
	   }
	   if(challange[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Any Command In Challenge - Use /leave");
	   }
	   else
	   {
	   SCM(playerid,COLOR_RED,"You Can't Use This Command While Watching Duels - Use /leavewatch");
	   }
	}
	return 1;
}
errors =
Код:
(3652) : warning 235: public function lacks forward declaration (symbol "OnPlayerOnPlayerCommandText")
(3655) : error 017: undefined symbol "playerid"
(3659) : error 017: undefined symbol "playerid"
(3659 -- 3688) : error 017: undefined symbol "playerid"
(3659 -- 3704) : error 017: undefined symbol "playerid"
(3659 -- 3704) : fatal error 107: too many error messages on one line
can u give example of
Quote:
Originally Posted by park4bmx
Посмотреть сообщение
another way is to put it into a function so you don't have to copy it and then just break the code with "return" if they don't match the variables you want.
Reply
#4

It's
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
Not

pawn Код:
OnPlayerCommandText()
Reply
#5

Why not using the cmd instead of cmd_groupleader(playerid,params) , try
Код:
CMD:leavedm(playerid, params[])
{
        #pragma unused params
        //Do something
	return 1;
}
You can do this step with out put OnPlayerCommandText..
Reply
#6

Quote:
Originally Posted by SPA
Посмотреть сообщение
Why not using the cmd instead of cmd_groupleader(playerid,params) , try
Код:
CMD:leavedm(playerid, params[])
{
        #pragma unused params
        //Do something
	return 1;
}
You can do this step with out put OnPlayerCommandText..
i have all cmds already all i wan't is if player in challenge or duel he can't use this cmd
Reply
#7

Quote:
Originally Posted by FalconWingsX
Посмотреть сообщение
It's
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
Not

pawn Код:
OnPlayerCommandText()
thanks and what should i write insted of params ?? in cmd_d(playerid,params);..
shall i write cmdtext?? or just playerid ??
Reply
#8

Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{

if(InDual[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Command While In Duel.");
	   }
	   if(challange[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Any Command In Challenge - Use /leave");
	   }
    return 0;
}

}
return 1;
}
Reply
#9

Quote:
Originally Posted by SPA
Посмотреть сообщение
Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{

if(InDual[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Command While In Duel.");
	   }
	   if(challange[playerid] == 1)
	   {
	   SCM(playerid, COLOR_RED, "You Can't Use Any Command In Challenge - Use /leave");
	   }
    return 0;
}

}
return 1;
}
but in this way i won't ab able to use /leave
Reply
#10

anyone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)