Cambio a strcmp
#1

Код:
CMD:bandas(playerid, params[])
{
    new string[128], familyid;

    if(sscanf(params, "d", familyid))
    {
        new number = 0;
        for(new i = 0; i < sizeof(fINFO); i++)
        {
            number ++;
               if(fINFO[i][FamilyTurfTokens] < 12)
            {
                format(string, sizeof(string), "Banda %d | Nombre: %s | Lider: %s | Miembros: %d.",number,fINFO[i][FamilyName],fINFO[i][FamilyLeader],fINFO[i][FamilyMembers]);
            }
            else
            {
                format(string, sizeof(string), "Banda %d | Nombre: %s | Lider: %s | Miembros: %d",number,fINFO[i][FamilyName],fINFO[i][FamilyLeader],fINFO[i][FamilyMembers]);
            }
            SendClientMessageEx(playerid, COLOR_WHITE, string);
        }
        return 1;
    }

    if(familyid < 1 || familyid > MAX_FAMILY) { SendClientMessageEx(playerid, COLOR_GREY, "Bandas: 1 - 14"); return 1; }
    familyid -= 1;
    if(fINFO[familyid][FamilyTaken] != 1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "Ese Slot estб vacнo.");
        return 1;
    }
    foreach(Player, i)
    {
        if(Info[i][pFMember] == familyid && Info[i][pFMember] != 255)
        {
            if(Info[i][pRank] == 1 && Info[i][pFMember] == familyid)
            {
                format(string, sizeof(string), "* %s: %s | Rango: %s (1).",fINFO[familyid][FamilyName],GetPlayerNameEx(i),fINFO[familyid][FamilyRank1]);
            }
            else if(Info[i][pRank] == 2 && Info[i][pFMember] == familyid)
            {
                format(string, sizeof(string), "* %s: %s | Rango: %s (2).",fINFO[familyid][FamilyName],GetPlayerNameEx(i),fINFO[familyid][FamilyRank2]);
            }
            else if(Info[i][pRank] == 3 && Info[i][pFMember] == familyid)
            {
                format(string, sizeof(string), "* %s: %s | Rango: %s (3).",fINFO[familyid][FamilyName],GetPlayerNameEx(i),fINFO[familyid][FamilyRank3]);
            }
            else if(Info[i][pRank] == 4 && Info[i][pFMember] == familyid)
            {
                format(string, sizeof(string), "* %s: %s | Rango: %s (4).",fINFO[familyid][FamilyName],GetPlayerNameEx(i),fINFO[familyid][FamilyRank4]);
            }
            else if(Info[i][pRank] == 5 && Info[i][pFMember] == familyid)
            {
                format(string, sizeof(string), "* %s: %s | Rango: %s (5).",fINFO[familyid][FamilyName],GetPlayerNameEx(i),fINFO[familyid][FamilyRank5]);
            }
            else if(Info[i][pRank] == 6 && Info[i][pFMember] == familyid)
            {
                format(string, sizeof(string), "* %s: %s | Rango: %s (6).",fINFO[familyid][FamilyName],GetPlayerNameEx(i),fINFO[familyid][FamilyRank6]);
            }
            SendClientMessageEx(playerid, COLOR_GREY, string);
        }
    }
    return 1;
}
Код:
if(strcmp(cmd, "/dropcar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
	    	if(PlayerOnMission[playerid] > 0)
		    {
      			SendClientMessage(playerid, COLOR_GREY, "   On a mission right now, can't use this command!");
       			return 1;
		    }
      		if(PlayerInfo[playerid][pCarTime] == 0)
        	{
         		GameTextForPlayer(playerid, "~w~Car Selling ~n~~r~Drop the car at the Crane", 5000, 1);
           		CP[playerid] = 1;
            	SetPlayerCheckpoint(playerid, 2506.5625,-2630.6484,13.6467,8.0);
	        }
	        else
	        {
         		SendClientMessage(playerid, COLOR_GREY, "   You already Dropped a car, wait till your reload time is over!");
	        }
		}//not connected
		return 1;
	}
Como podria cambiar estos 2 codigos a strcmp ? es posible?
Reply


Messages In This Thread
Cambio a strcmp - by Jaua10 - 05.07.2016, 00:28
Respuesta: Cambio a strcmp - by Goncho28 - 05.07.2016, 04:36
Respuesta: Cambio a strcmp - by Jaua10 - 05.07.2016, 06:38
Respuesta: Cambio a strcmp - by Jaua10 - 07.07.2016, 06:18

Forum Jump:


Users browsing this thread: 1 Guest(s)