GetPlayer Team
#4

Well, I could do this before. But actually, I want to save team name in mysql.

I'm using like this:

PHP код:
new gTeam[MAX_PLAYERS];
new 
gPlayerClass[MAX_PLAYERS];
///Player Classes
forward SetPlayerTeamFromClass(playeridclassid);
public 
SetPlayerTeamFromClass(playeridclassid)
{
    
SetupPlayerForClassSelection(playerid,classid);
    
gPlayerClass[playerid] = classid;
    {
    if (
classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == 10 || classid == 11)
    {
         
gTeam[playerid] = COPS;
         
GameTextForPlayer(playerid"~b~POLICE OFFICER"6005);
        return 
1;
    }
    else if (
classid == 12 )
    {
         
gTeam[playerid] = ARMY;
         
GameTextForPlayer(playerid"~b~~h~ARMY"5005);
         return 
1;
     }
    else if (
classid == 13)
    {
         
gTeam[playerid] = FBI;
         
GameTextForPlayer(playerid"~b~FBI"5005);
         return 
1;
    }
    else if (
classid == 14 || classid == 15 || classid == 16)
    {
        
gTeam[playerid] = CIA;
            
GameTextForPlayer(playerid"~w~CIA"5005);
        return 
1;
    }
    else if (
classid == 17 || classid == 18 || classid == 19 || classid == 20)
    {
        
gTeam[playerid] = MEDICS;
            
GameTextForPlayer(playerid"~p~~h~MEDIC"5005);
        return 
1;
    }
    else if (
classid >= 21)
    {
        
gTeam[playerid] = CIVILIANS;
            
GameTextForPlayer(playerid"~w~CIVILIAN"5005);
        return 
1;
    }
    return 
1;
    }

im just confused what should i add here for get player team name

PHP код:
forward OnPlayerSave(playerid);
public 
OnPlayerSave(playerid)
{
    new 
query[500];
    if(
IsLoggedIn[playerid] == && playerid != INVALID_PLAYER_ID && !IsPlayerNPC(playerid))
    {
        
mysql_format(MySQLConquerysizeof(query), "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `Deaths`=%d, `Kills`=%d, `SkinID`=%d, `Robbed`=%d, `RobbedMoney`=%d, `GotRobbed`=%d, `GotRobbedMoney`=%d, `StoreRobbed`=%d, `StoreRobbedMoney`=%d, `FoodPurchased`=%d, `FoodPurchasedMoney`=%d, `WeaponsPurchased`=%d, `WeaponsPurchasedMoney`=%d WHERE `ID`=%d AND `user`='%e'",
        
pInfo[playerid][pAdmin],
        
pInfo[playerid][pVip],
        
GetPlayerMoney(playerid),
        
GetPlayerScore(playerid),
        
pInfo[playerid][pDeaths],
        
pInfo[playerid][pKills],
        
GetPlayerSkin(playerid),
        
pInfo[playerid][pRobbed],
        
pInfo[playerid][pRobbedMoney],
        
pInfo[playerid][pGotRobbed],
        
pInfo[playerid][pGotRobbedMoney],
        
pInfo[playerid][pStoreRobbed],
        
pInfo[playerid][pStoreRobbedMoney],
        
pInfo[playerid][pFoodPurchased],
        
pInfo[playerid][pFoodPurchasedMoney],
        
pInfo[playerid][pWeaponsPurchased],
        
pInfo[playerid][pWeaponsPurchasedMoney],
        
pInfo[playerid][pID],
        
PlayerName(playerid));
        
mysql_tquery(MySQLConquery"""");
        print(
query);
        
mysql_format(MySQLConquerysizeof(query), "UPDATE `players` SET `IsBanned`=%d WHERE `ID`=%d AND user='%e'"pInfo[playerid][pIsBanned], PlayerName(playerid));
        
mysql_tquery(MySQLConquery"""");
        
IsLoggedIn[playerid] = 0;
        if(
pInfo[playerid][pAdmin] >= 1)
        {
            
mysql_format(MySQLConquerysizeof(query), "UPDATE `players` SET `AdminName`=%s WHERE `ID`=%d AND `user`='%e'"pInfo[playerid][pAName]);
            return 
true;
        }
    }
    return 
1;

Reply


Messages In This Thread
GetPlayer Team - by STONEGOLD - 21.06.2015, 10:19
Re: GetPlayer Team - by Dusan01 - 21.06.2015, 10:23
Re: GetPlayer Team - by [XST]O_x - 21.06.2015, 10:31
Re: GetPlayer Team - by STONEGOLD - 21.06.2015, 10:56
Re: GetPlayer Team - by STONEGOLD - 21.06.2015, 10:59
Re: GetPlayer Team - by Dusan01 - 21.06.2015, 11:06
Re: GetPlayer Team - by [XST]O_x - 21.06.2015, 11:14
Re: GetPlayer Team - by STONEGOLD - 21.06.2015, 11:55
Re: GetPlayer Team - by Dusan01 - 21.06.2015, 11:59
Re: GetPlayer Team - by STONEGOLD - 22.06.2015, 04:50

Forum Jump:


Users browsing this thread: 1 Guest(s)