Help for 2 commands..
#10

Try these out, if there is an error tell me. You should try using sscanf and zcmd to make it easier.


Код:
if(strcmp(cmd, "/givekill", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givekill [kills]");
			return 1;
		}
		
		new kills1;
		tmp = strtok(cmdtext, idx);
		kills1 = strval(tmp);
		if (PlayerInfo[playerid][pAdmin] == 1337)
		{
			for(new i = 0; i <MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
					if(i != INVALID_PLAYER_ID)
					{
						PlayerInfo[i][pKills] += kills1;
						SetPlayerScore(i, PlayerInfo[playa][pKills]);
					}
				}
			}
		}
	}
	return 1;
}
Код:
if(strcmp(cmd, "/givemoney", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [money]");
			return 1;
		}
		
		new money;
		tmp = strtok(cmdtext, idx);
		money = strval(tmp);
		if (PlayerInfo[playerid][pAdmin] >= 1337)
		{
			for(new i = 0; i <MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
					if(i != INVALID_PLAYER_ID)
					{
						GivePlayerCash(i, money);
					}
				}
			}
		}
	}
	return 1;
}
Reply


Messages In This Thread
Help for 2 commands.. - by Ruffian - 08.09.2012, 12:07
Re: Help for 2 commands.. - by [HK]Ryder[AN] - 08.09.2012, 12:33
Re: Help for 2 commands.. - by Ruffian - 08.09.2012, 15:33
Re: Help for 2 commands.. - by [HK]Ryder[AN] - 08.09.2012, 16:33
Re: Help for 2 commands.. - by Ruffian - 08.09.2012, 16:44
Re: Help for 2 commands.. - by Ruffian - 08.09.2012, 19:47
Re: Help for 2 commands.. - by Ruffian - 08.09.2012, 21:00
Re: Help for 2 commands.. - by Chenko - 08.09.2012, 21:38
Re: Help for 2 commands.. - by Ruffian - 08.09.2012, 22:03
Re: Help for 2 commands.. - by Chenko - 08.09.2012, 22:13

Forum Jump:


Users browsing this thread: 1 Guest(s)