I can't understand how "dcmd" works.
#1

So here is my code. What i'm trying to do is, when player types /bomb plant, it shows "You typed 'plant'".
But when the player typed /bomb defuse, it shows "You typed 'defuse'".
Can anyone please help me?

Код:
dcmd_bomb(playerid,params[])
{
    new tmp[256], Index;
    new plant, defuse;
    tmp = strtok(params,Index);
    if(!strlen(params)) return SendClientMessage(playerid,GREY,"ERROR: /bomb [plant/defuse]");
	if(strlen(tmp) == defuse)
	{
	SendClientMessage(playerid, GREY, "You typed 'defuse'");
	return 1;
	}
	if(strlen(tmp) == plant)
	{
	SendClientMessage(playerid, GREY, "You typed 'plant'");
	return 1;
	}
	return 1;
}
Reply


Messages In This Thread
I can't understand how "dcmd" works. - by Shetch - 04.09.2011, 13:18
Re: I can't understand how "dcmd" works. - by JaTochNietDan - 04.09.2011, 13:42
Re: I can't understand how "dcmd" works. - by Shetch - 04.09.2011, 13:57

Forum Jump:


Users browsing this thread: 1 Guest(s)