23.09.2011, 16:14
i did this
I type /setstat IG and nothing happend!
What to do?
pawn Код:
if(strcmp(cmd, "/setstat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE:{FFFFFF} /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|8 HouseKey |9 BizKey |10 DonateRank");
SendClientMessage(playerid, COLOR_GRAD2, "|11 FMember |12 FLeader |13 Playing hour |19 Box");
SendClientMessage(playerid, COLOR_GRAD2, "|20 PassKey |21 VehKey1 |22 VehKey2 |23 VehKey3");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE:{FFFFFF} /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 |8 HouseKey |9 BizKey |10 DonateRank");
SendClientMessage(playerid, COLOR_GRAD2, "|11 FMember |12 FLeader |13 Playing hour |19 Box");
SendClientMessage(playerid, COLOR_GRAD2, "|20 PassKey |21 VehKey1 |22 VehKey2 |23 VehKey3");
return 1;
}
new stat;
stat = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE:{FFFFFF} /setstat [playerid/PartOfName] [statcode] [amount]");
SendClientMessage(playerid, COLOR_GRAD4, "|2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
SendClientMessage(playerid, COLOR_GRAD3, "|6 PhoneNumber |8 HouseKey |9 BizKey |10 DonateRank");
SendClientMessage(playerid, COLOR_GRAD2, "|11 FMember |12 FLeader |13 Playing hour |19 Box");
SendClientMessage(playerid, COLOR_GRAD2, "|20 PassKey |21 VehKey1 |22 VehKey2 |23 VehKey3");
return 1;
}
new amount;
amount = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
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:
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid Stat Code");
}
}
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;
}
What to do?