Should Return value
#3

PHP код:
CMD:enterfaction(playeridparams[])
{
    new 
groupID;
    new 
userID playerid;
    if(
sscanf(params"d"groupID)) 
        return 
SendClientMessage(playeridCOLOR_GREYSYNTAX_MESSAGE"/EnterFaction [FactionID]");
    else
    {
        if(
groupID || groupID MAX_GROUPS) return SendClientMessage(playeridCOLOR_GREY"Invalid group ID->:");
        
SendClientMessage(playeridCOLOR_GREY"LSPD(1) - F.B.I(2) - National Guard(3) - Paramedic Departament(4);");
        
SendClientMessage(playeridCOLOR_GREY"Guvernment(5) - The Russian Mafia(6) - Groove Street(7) - Los Aztecas(8);");
        
SendClientMessage(playeridCOLOR_GREY"Ballas(9) - Los Vagos(10) - Hitman Agency(11) - School Instructors(12);");
        
SendClientMessage(playeridCOLOR_GREY"Taxi Company(13) - News Reporters(14) - Las Barrancas Taxi Company(15).");
        if(
playerVariables[userID][pGroup] == 0)
        {
            
format(szMessage256"UPDATE playeraccounts set playerDays = 0 WHERE playerID = '%d'"playerVariables[userID][pInternalID]);
            
mysql_tquery(handle,szMessage);
            
playerVariables[userID][pGroup] = groupID;
            
playerVariables[userID][pGroupRank] = 1;
            
SetPlayerToTeamColor(userID);
            new 
string[256];
            
GetPlayerName(userIDszPlayerNameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "Ai intrat in: %s."szPlayerNamegroupVariables[groupID][gGroupName]);
            
SendClientMessage(playeridCOLOR_WHITEstring);
            
GetPlayerName(userIDszPlayerNameMAX_PLAYER_NAME);
            new 
query[500];
            
format(stringsizeof(string), "<< %s a intrat in factiunea %s. >>"szPlayerName,groupVariables[groupID][gGroupName]);
            
format(querysizeof(query), "INSERT INTO faction_logs (text, playerID) VALUES ('%s', '%d')"string,playerVariables[userID][pInternalID]);
            
mysql_tquery(handle,query);
            
format(querysizeof(query), "INSERT INTO flogs (text, playerID, faction) VALUES ('%s', '%d', '%d')"string,playerVariables[userID][pInternalID], playerVariables[userID][pGroup]);
            
mysql_tquery(handle,query);
            if(
playerVariables[userID][pGroup] == 1)
            {
                
SetPlayerSkin(userID284);
                
playerVariables[userID][pSkin] = 284;
            }
            if(
playerVariables[userID][pGroup] == 2)
            {
                
SetPlayerSkin(userID163);
                
playerVariables[userID][pSkin] = 163;
            }
            if(
playerVariables[playerid][pGroup] == 3)
            {
                    
SetPlayerSkin(playerid287);
                    
playerVariables[playerid][pSkin] = 287;
            }
            if(
playerVariables[playerid][pGroup] == 4)
            {
                    
SetPlayerSkin(playerid276);
                    
playerVariables[playerid][pSkin] = 276;
            }
            if(
playerVariables[playerid][pGroup] == 5)
            {
                    
SetPlayerSkin(playerid284);
                    
playerVariables[playerid][pSkin] = 284;
            }
            if(
playerVariables[playerid][pGroup] == 6)
            {
                    
SetPlayerSkin(playerid73);
                    
playerVariables[playerid][pSkin] = 73;
            }
            if(
playerVariables[playerid][pGroup] == 7)
            {
                    
SetPlayerSkin(playerid106);
                    
playerVariables[playerid][pSkin] = 106;
            }
            if(
playerVariables[playerid][pGroup] == 8)
            {
                    
SetPlayerSkin(playerid116);
                    
playerVariables[playerid][pSkin] = 116;
            }
            if(
playerVariables[playerid][pGroup] == 9)
            {
                    
SetPlayerSkin(playerid175);
                    
playerVariables[playerid][pSkin] = 175;
            }
            if(
playerVariables[playerid][pGroup] == 10)
            {
                    
SetPlayerSkin(playerid104);
                    
playerVariables[playerid][pSkin] = 104;
            }
            if(
playerVariables[playerid][pGroup] == 11)
            {
                    
SetPlayerSkin(playerid110);
                    
playerVariables[playerid][pSkin] = 110;
            }
            if(
playerVariables[playerid][pGroup] == 12)
            {
                    
SetPlayerSkin(playerid208);
                    
playerVariables[playerid][pSkin] = 208;
            }
            if(
playerVariables[playerid][pGroup] == 13)
            {
                    
SetPlayerSkin(playerid153);
                    
playerVariables[playerid][pSkin] = 153;
            }
            if(
playerVariables[playerid][pGroup] == 14)
            {
                    
SetPlayerSkin(playerid253);
                    
playerVariables[playerid][pSkin] = 253;
            }
            if(
playerVariables[playerid][pGroup] == 15)
            {
                    
SetPlayerSkin(playerid188);
                    
playerVariables[playerid][pSkin] = 188;
            }
        }
        else return 
SCM(playeridCOLOR_WHITE"Esti deja intr-o factiune [/quitgroup]!");
    }
    return 
1;

Too many : }
Reply


Messages In This Thread
Should Return value - by Longover - 26.01.2018, 15:16
Re: Should Return value - by Fratello - 26.01.2018, 15:31
Re: Should Return value - by Dayrion - 26.01.2018, 15:50

Forum Jump:


Users browsing this thread: 1 Guest(s)