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