12.03.2018, 22:09
Hello, I'm trying to fix my Aduty command when you go onduty it loads the AdminName and when you go offduty it loads back your username but I keep struggling with errors
command:
Код:
./includes/commands.pwn(39074) : warning 202: number of arguments does not match definition ./includes/commands.pwn(39074) : error 036: empty statement ./includes/commands.pwn(39100) : warning 202: number of arguments does not match definition ./includes/commands.pwn(39100) : error 036: empty statement Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
PHP код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(AdminDuty[playerid] == 0)
{
39074 if(SetPlayerName(playerid) == 1);
{
new tmpName[24], query[128];
format(query, sizeof(query), "SELECT `AdminName` FROM `accounts` WHERE `AdminName`='%s'", tmpName);
mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
new Float:health, Float:armor, string[250];
SendClientMessage(playerid, COLOR_WHITE, "You are now On-Duty..");
format(string, sizeof(string), "%s %s is now on admin duty ((/report for assistance ))", GetStaffRank(playerid), GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_WHITE, string);
Log("logs/adminonduty.log", string);
PlayerInfo[playerid][pAdminDuty] = 1;
AdminDuty[playerid] = 1;
GetPlayerHealth(playerid,health);
SetPVarFloat(playerid, "pPreGodHealth", health);
GetPlayerArmour(playerid,armor);
SetPVarFloat(playerid, "pPreGodArmor", armor);
SetPlayerHealth(playerid, 0x7FB00000);
SetPlayerArmor(playerid, 0x7FB00000);
SetPVarInt(playerid, "pGodMode", 1);
}
else if(AdminDuty[playerid] == 1)
{
39100 if(SetPlayerName(playerid) == 1);
{
new tmpName[24], query[128];
format(query, sizeof(query), "SELECT `Username` FROM `accounts` WHERE `Username`='%s'", tmpName);
mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
new string[250];
SendClientMessage(playerid, COLOR_WHITE, "You are now Off-Duty.");
SendClientMessage(playerid, COLOR_REALRED, "Please remember to turn off any hacks you may have (press F12 to disable ******).");
format(string, sizeof(string), "%s %s is now off admin duty ", GetStaffRank(playerid), GetPlayerNameEx(playerid));
ABroadCast(COLOR_WHITE, string, 1);
Log("logs/adminoffduty.log", string);
PlayerInfo[playerid][pAdminDuty] = 0;
AdminDuty[playerid] = 0;
new Float:health, Float:armor;
health = GetPVarFloat(playerid, "pPreGodHealth");
SetPlayerHealth(playerid,health);
armor = GetPVarFloat(playerid, "pPreGodArmor");
SetPlayerArmor(playerid, armor);
DeletePVar(playerid, "pGodMode");
DeletePVar(playerid, "pPreGodHealth");
DeletePVar(playerid, "pPreGodArmor");
if(PlayerInfo[playerid][pAdmin] < 99999)
{
ResetPlayerWeapons(playerid);
ResetPlayerCash(playerid);
DeletePVar(playerid, "Packages");
PlayerInfo[playerid][pLiveBanned] = 0;
PlayerInfo[playerid][pPnumber] = 0;
PlayerInfo[playerid][pWarns] = 0;
PlayerInfo[playerid][pFMember] = 255;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pJob2] = 0;
//PlayerInfo[playerid][pDonateRank] = 0;
PlayerInfo[playerid][gPupgrade] = 0;
PlayerInfo[playerid][pCash] = 10000;
PlayerInfo[playerid][pAccount] = 0;
PlayerInfo[playerid][pInsurance] = 0;
PlayerInfo[playerid][pCrimes] = 0;
PlayerInfo[playerid][pArrested] = 0;
PlayerInfo[playerid][pWantedLevel] = 0;
PlayerInfo[playerid][pHealth] = 100;
PlayerInfo[playerid][pArmor] = 0;
PlayerInfo[playerid][pPot] = 0;
PlayerInfo[playerid][pCrack] = 0;
PlayerInfo[playerid][pCrates] = 0;
PlayerInfo[playerid][pRadio] = 0;
PlayerInfo[playerid][pRadioFreq] = 0;
PlayerInfo[playerid][pMats] = 0;
PlayerInfo[playerid][pRope] = 0;
PlayerInfo[playerid][pCigar] = 0;
PlayerInfo[playerid][pSprunk] = 0;
PlayerInfo[playerid][pSpraycan] = 0;
PlayerInfo[playerid][pPhousekey] = INVALID_HOUSE_ID;
PlayerInfo[playerid][pPhousekey2] = INVALID_HOUSE_ID;
PlayerInfo[playerid][pRenting] = INVALID_HOUSE_ID;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pVW] = 0;
PlayerInfo[playerid][pJailTime] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pDetSkill] = 0;
PlayerInfo[playerid][pLawSkill] = 0;
PlayerInfo[playerid][pSexSkill] = 0;
PlayerInfo[playerid][pDrugsSkill] = 0;
PlayerInfo[playerid][pSmugSkill] = 0;
PlayerInfo[playerid][pArmsSkill] = 0;
PlayerInfo[playerid][pMechSkill] = 0;
PlayerInfo[playerid][pFishSkill] = 0;
PlayerInfo[playerid][pBoxSkill] = 0;
PlayerInfo[playerid][pTruckSkill] = 0;
PlayerInfo[playerid][pLawyerTime] = 0;
PlayerInfo[playerid][pLawyerFreeTime] = 0;
PlayerInfo[playerid][pDrugsTime] = 0;
PlayerInfo[playerid][pMechTime] = 0;
PlayerInfo[playerid][pSexTime] = 0;
PlayerInfo[playerid][pFishes] = 0;
PlayerInfo[playerid][pBiggestFish] = 0;
PlayerInfo[playerid][pScrewdriver] = 0;
PlayerInfo[playerid][pSmslog] = 0;
PlayerInfo[playerid][pWristwatch] = 0;
PlayerInfo[playerid][pTire] = 0;
PlayerInfo[playerid][pFirstaid] = 0;
PlayerInfo[playerid][pRccam] = 0;
PlayerInfo[playerid][pReceiver] = 0;
PlayerInfo[playerid][pGPS] = 0;
PlayerInfo[playerid][pSweep] = 0;
PlayerInfo[playerid][pSweepLeft] = 0;
PlayerInfo[playerid][pVehicleKeys] = INVALID_PLAYER_VEHICLE_ID; // non-saved
PlayerInfo[playerid][pVehicleKeysFrom] = INVALID_PLAYER_ID; // non-saved
PlayerInfo[playerid][pCarLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFishLic] = 1;
PlayerInfo[playerid][pGunLic] = 1;
PlayerInfo[playerid][pDivision] = 0;
PlayerInfo[playerid][pTicketTime] = 0;
PlayerInfo[playerid][pHeadValue] = 0;
strcpy(PlayerInfo[playerid][pContractBy], "Nobody", 64);
strcpy(PlayerInfo[playerid][pContractDetail], "None", 64);
PlayerInfo[playerid][pC4] = 0;
PlayerInfo[playerid][pC4Used] = 0;
PlayerInfo[playerid][pBombs] = 0;
PlayerInfo[playerid][pCHits] = 0;
PlayerInfo[playerid][pFHits] = 0;
strcpy(PlayerInfo[playerid][pPrisonedBy], "Nobody", 64);
strcpy(PlayerInfo[playerid][pPrisonReason], "None", 64);
PlayerInfo[playerid][pAcceptReport] = 0;
PlayerInfo[playerid][pTrashReport] = 0;
PlayerInfo[playerid][pAccent] = 0;
PlayerInfo[playerid][pNMute] = 0;
PlayerInfo[playerid][pNMuteTotal] = 0;
PlayerInfo[playerid][pADMute] = 0;
PlayerInfo[playerid][pADMuteTotal] = 0;
PlayerInfo[playerid][pRMuted] = 0;
PlayerInfo[playerid][pRMutedTotal] = 0;
PlayerInfo[playerid][pRMutedTime] = 0;
PlayerInfo[playerid][pGCMuted] = 0;
PlayerInfo[playerid][pGCMutedTime] = 0;
PlayerInfo[playerid][pCallsAccepted] = 0;
PlayerInfo[playerid][pPatientsDelivered] = 0;
PlayerInfo[playerid][pTriageTime] = 0;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
}
return 1;
}