if (strcmp("/heal", cmdtext, true, 10) == 0)
CMD:stamina(playerid,params[])
{
new option[20];
if(isnull(params))
{
SendClientMessage(playerid , -1 /*You can use your color*/ , " /estamina <0 or 1> ");
}
if(!strcmp(option, "0", true))
{
SendClientMessage(playerid,-1 , " Now Player's will lose Stamina");
return 1;
}
else
if(!strcmp(option, "1", true))
{
SendClientMessage(playerid,-1 , " Now player's will not lose their Stamina");
ClearAnimations(MAX_PLAYERS);
SetTimer("anim",4000,true);
return 1;
}
return 1;
}
forward anim();
public anim()
{
ClearAnimations(MAX_PLAYERS);
return 1;
}
|
and dude , as i dont want to spam the Topic's i got another doubt...
What's my mistake in this code? Код:
CMD:stamina(playerid,params[])
{
new option[20];
if(isnull(params))
{
SendClientMessage(playerid , -1 /*You can use your color*/ , " /estamina <0 or 1> ");
}
if(!strcmp(option, "0", true))
{
SendClientMessage(playerid,-1 , " Now Player's will lose Stamina");
return 1;
}
else
if(!strcmp(option, "1", true))
{
SendClientMessage(playerid,-1 , " Now player's will not lose their Stamina");
ClearAnimations(MAX_PLAYERS);
SetTimerEx("anim",4000,true, "i", playerid);
return 1;
}
return 1;
}
forward anim(playerid);
public anim(playerid)
{
ClearAnimations(playerid);
return 1;
}
|
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
CMD:stamina(playerid,params[])
{
new option;
if(isnull(params)) return SendClientMessage(playerid , -1 /*You can use your color*/ , " /estamina <0 or 1> ");
if(!IsNumeric(params)) return SendClientMessage(playerid , -1 /*You can use your color*/ , " /estamina <0 or 1> ");
option = strval(params);
if(option==0)
{
SendClientMessage(playerid,-1 , " Now Player's will lose Stamina");
return 1;
}
if(option==1)
{
SendClientMessage(playerid,-1 , " Now player's will not lose their Stamina");
ClearAnimations(MAX_PLAYERS);
SetTimer("anim",4000,true);
return 1;
}
return 1;
}
forward anim();
public anim()
{
ClearAnimations(MAX_PLAYERS);
return 1;
}