setstat won't work
#7

PHP код:
if(strcmp(cmd"/setstatevg2648"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /setstat [playerid/PartOfName] [statcode] [amount]");
                
SendClientMessage(playeridCOLOR_GRAD4"|1 Level |2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
                
SendClientMessage(playeridCOLOR_GRAD3"|6 PhoneNumber |7 RespectPoints |8 HouseKey |9 BizKey |10 DonateRank");
                
SendClientMessage(playeridCOLOR_GRAD2"|11 Member| 12 VehKey1 |13 VehKey2 |14 VehKey3| 15 Expire Date| 16 Job");
                
SendClientMessage(playeridCOLOR_GRAD2"|17 Job Delay| 18 Crimes |19 Arrestes | 20 Changes | 21 Donate Gate");
                
SendClientMessage(playeridCOLOR_GRAD2"|22 Furniture Locked|");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if(
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
tmp strtok(cmdtextidx);
                    if(!
strlen(tmp))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /setstat [playerid/PartOfName] [statcode] [amount]");
                        
SendClientMessage(playeridCOLOR_GRAD4"|1 Level |2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
                        
SendClientMessage(playeridCOLOR_GRAD3"|6 PhoneNumber |7 RespectPoints |8 HouseKey |9 BizKey |10 DonateRank");
                        
SendClientMessage(playeridCOLOR_GRAD2"|11 Member| 12 VehKey1 |13 VehKey2 |14 VehKey3| 15 Expire Date| 16 Job");
                        
SendClientMessage(playeridCOLOR_GRAD2"|17 Job Delay| 18 Crimes |19 Arrestes | 20 Changes | 21 Donate Gate");
                        
SendClientMessage(playeridCOLOR_GRAD2"|22 Furniture Locked|");
                        return 
1;
                    }
                    new 
stat;
                    
stat strval(tmp);
                    
tmp strtok(cmdtextidx);
                    if(!
strlen(tmp))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /setstat [playerid/PartOfName] [statcode] [amount]");
                        
SendClientMessage(playeridCOLOR_GRAD4"|1 Level |2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
                        
SendClientMessage(playeridCOLOR_GRAD3"|6 PhoneNumber |7 RespectPoints |8 HouseKey |9 BizKey |10 DonateRank");
                        
SendClientMessage(playeridCOLOR_GRAD2"|11 Member| 12 VehKey1 |13 VehKey2 |14 VehKey3| 15 Expire Date| 16 Job");
                        
SendClientMessage(playeridCOLOR_GRAD2"|17 Job Delay| 18 Crimes |19 Arrestes | 20 Changes | 21 Donate Gate");
                        
SendClientMessage(playeridCOLOR_GRAD2"|22 Furniture Locked|");
                        return 
1;
                    }
                    new 
amount;
                    
amount strval(tmp);
                    if (
PlayerInfo[playerid][pAdmin] >= 5)
                    {
                        switch (
stat)
                        {
                                                    case 
2:
                            {
                                
PlayerInfo[giveplayerid][pSHealth] = amount;
                                
format(stringsizeof(string), "%s has set %s spawn health to %d."sendername,giveplayer,amount);
                            }
                            case 
3:
                            {
                                
PlayerInfo[giveplayerid][gPupgrade] = amount;
                                
format(stringsizeof(string), "%s has set %s upgrade points to %d."sendername,giveplayer,amount);
                            }
                            case 
4:
                            {
                                
PlayerInfo[giveplayerid][pModel] = amount;
                                
format(stringsizeof(string), "%s has set %s model to %d."sendername,giveplayer,amount);
                            }
                            case 
5:
                            {
                                
PlayerInfo[giveplayerid][pAccount] = amount;
                                
format(stringsizeof(string), "%s has set %s bank money to %d."sendername,giveplayer,amount);
                            }
                            case 
6:
                            {
                                
PlayerInfo[giveplayerid][pPnumber] = amount;
                                
format(stringsizeof(string), "%s has set %s phone number to %d."sendername,giveplayer,amount);
                            }
                            case 
8:
                            {
                                
PlayerInfo[giveplayerid][pPhousekey] = amount;
                                
format(stringsizeof(string), "%s has set %s house key to %d."sendername,giveplayer,amount);
                            }
                            case 
9:
                            {
                                
PlayerInfo[giveplayerid][pPbiskey] = amount;
                                
format(stringsizeof(string), "%s has set %s business key to %d."sendername,giveplayer,amount);
                            }
                            case 
10:
                            {
                                
PlayerInfo[giveplayerid][pDonateRank] = amount;
                                
format(stringsizeof(string), "%s has set %s donate rank to %d."sendername,giveplayer,amount);
                            }
                            case 
11:
                            {
                                
PlayerInfo[giveplayerid][pFMember] = amount;
                                
format(stringsizeof(string), "%s has set %s family member to %d."sendername,giveplayer,amount);
                            }
                            case 
12:
                            {
                                
PlayerInfo[giveplayerid][pFLeader] = amount;
                                
format(stringsizeof(string), "%s has set %s family leader to %d."sendername,giveplayer,amount);
                            }
                            case 
13:
                            {
                                
PlayerInfo[giveplayerid][pConnectTime] = amount;
                                
format(stringsizeof(string), "%s has set %s playing hours to %d."sendername,giveplayer,amount);
                            }
                            case 
19:
                            {
                                
PlayerInfo[giveplayerid][pBoxSkill] = amount;
                                
format(stringsizeof(string), "%s has set %s box skill to %d."sendername,giveplayer,amount);
                            }
                            case 
21:
                            {
                                
PlayerInfo[giveplayerid][pPcarkey] = amount;
                                
format(stringsizeof(string), "%s has set %s veh key 1 to %d."sendername,giveplayer,amount);
                            }
                            case 
22:
                            {
                                
PlayerInfo[giveplayerid][pPcarkey2] = amount;
                                
format(stringsizeof(string), "%s has set %s veh key 2 to %d."sendername,giveplayer,amount);
                            }
                            case 
23:
                            {
                                
PlayerInfo[giveplayerid][pPcarkey3] = amount;
                                
format(stringsizeof(string), "%s has set %s veh key 3 to %d."sendername,giveplayer,amount);
                            }
                            case 
77:
                            {
                                
PlayerInfo[giveplayerid][pJob] = amount;
                                
format(stringsizeof(string), "%s has set %s job to %d."sendername,giveplayer,amount);
                            }
                            case 
88:
                            {
                                
PlayerInfo[giveplayerid][pContractTime] = amount;
                                
format(stringsizeof(string), "%s has set %s contract time to %d."sendername,giveplayer,amount);
                            }
                            default:
                            {
                                
format(stringsizeof(string), "   Invalid Stat Code"ammount);
                            }

                        }
                        
SendClientMessage(playeridCOLOR_GRAD1string);
                        
SetStatLog(string);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"   you are not authorized to use that command!");
                    }
                }
//not valid id
            
}//not connected
        
}
        return 
1;
    } 
Try this.
Reply


Messages In This Thread
setstat won't work - by Chris_Morrison - 23.09.2011, 16:14
Re: setstat won't work - by Fat - 23.09.2011, 16:31
Re: setstat won't work - by Chris_Morrison - 23.09.2011, 16:41
Re: setstat won't work - by Fat - 23.09.2011, 17:15
Re: setstat won't work - by Chris_Morrison - 23.09.2011, 17:33
Re: setstat won't work - by Chris_Morrison - 23.09.2011, 21:52
Re: setstat won't work - by =WoR=G4M3Ov3r - 23.09.2011, 22:33
Re: setstat won't work - by Chris_Morrison - 24.09.2011, 14:37
Re: setstat won't work - by CmZxC - 24.09.2011, 14:38
Re: setstat won't work - by MichaelNerd - 14.10.2011, 16:21

Forum Jump:


Users browsing this thread: 1 Guest(s)