[ajuda]strtok
#2

Код:
	if(strcmp(cmd, "/darvida", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "[AV] /darvida [IdDOPlayer/ParteDoNome] [health]");
				return 1;
			}
			new playa;
			new health;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			health = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						if(IsPlayerNPC(playa))
						{
						    SendClientMessage(playerid, CAZUL, " Vocк й retardado? estб tentando matar um NPC!!");
						    return 1;
						}
                        SetPlayerHealth(playa, health);
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						format(string, 256, "[AV] %s setou o hp de %s (%d) para %d.", sendername,giveplayer,playa,health);
						ABroadCast(COLOR_LIGHTRED,string, 5);
						format(string, sizeof(string), "Admin %s setou seu HP para %d",GetPlayerNameEx(playerid), health);
						SendClientMessage(playa, TEAM_GROVE_COLOR, string);
						new y, m, d;
						new h,mi,s;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s setou o hp de %s's para [%d]",d,m,y,h,mi,s,sendername,giveplayer,health);
						GiveLog(string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "[AV] vocк nгo estб autorizado a usar esse comando!");
			}
		}
		return 1;
	}
Exemplo de um com 3
Reply


Messages In This Thread
[ajuda]strtok - by kshorro - 02.12.2011, 12:52
Re: [ajuda]strtok - by Xpectro - 02.12.2011, 12:57
Re: [ajuda]strtok - by ExpressxD - 02.12.2011, 12:59
Re: [ajuda]strtok - by |_MeGaTroN_| - 02.12.2011, 13:00
Re: [ajuda]strtok - by Josma_cmd - 02.12.2011, 13:13
Re: [ajuda]strtok - by Xpectro - 02.12.2011, 21:25
Re: [ajuda]strtok - by |_MeGaTroN_| - 02.12.2011, 22:14
Re: [ajuda]strtok - by WLSF - 02.12.2011, 22:30
Re: [ajuda]strtok - by Xpectro - 03.12.2011, 02:29

Forum Jump:


Users browsing this thread: 1 Guest(s)