Give command dont work..
#6

Код:
	if(strcmp(cmd,"/setkill",true) == 0)
	{
	    tmp = strtok(cmdtext,idx);
	    if(!strlen(tmp))
	    {
	        SendClientMessage(playerid,COLOR_WHITE,"USAGE: /setkill [Playerid/PartOfName] [kills]");
	        return 1;
	    }
	    new playa;
		playa = ReturnUser(tmp);
		tmp = strrest(cmdtext,idx);
		if(IsPlayerConnected(playa))
		{
		    PlayerInfo[playa][pKills] = strval(tmp);
		    SetPlayerScore(playa,PlayerInfo[playa][pKills]);
		}
		return 1;
	}
	if(strcmp(cmd,"/givekill",true) == 0)
	{
	    tmp = strtok(cmdtext,idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_WHITE,"USAGE: /givekill [Playerid/PartOfName] [kills]");
			return 1;
		}
		new playa;
		playa = ReturnUser(tmp);
		tmp = strrest(cmdtext,idx);
		if(PlayerInfo[playerid][pAdmin] == 1337)
		{
  			if(IsPlayerConnected(playa))
			{
				PlayerInfo[playa][pKills] += strval(tmp);
				SetPlayerScore(playa,PlayerInfo[playa][pKills]);
  			}
		}
		return 1;
	}
Код:
stock strrest(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
	new offset = index;
	new result[128];
	while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
Reply


Messages In This Thread
Give command dont work.. - by dundolina - 25.11.2014, 12:00
Re : Give command dont work.. - by Dutheil - 25.11.2014, 12:34
Re: Give command dont work.. - by DavidBilla - 25.11.2014, 12:37
Re: Give command dont work.. - by dundolina - 25.11.2014, 19:39
Re: Give command dont work.. - by dundolina - 26.11.2014, 10:30
Re: Give command dont work.. - by Raweresh - 26.11.2014, 11:21
Re: Give command dont work.. - by dundolina - 26.11.2014, 12:15
Re: Give command dont work.. - by dundolina - 26.11.2014, 16:41
Re: Give command dont work.. - by dundolina - 26.11.2014, 20:30
Re: Give command dont work.. - by Raweresh - 26.11.2014, 21:58

Forum Jump:


Users browsing this thread: 2 Guest(s)