/oprison does not work correctly
#1

Код:
IRP:oprison(playerid, var[])
{
    new user[32], string[128], file[32], time;
   	if(!Logged(playerid)) return NoLogin(playerid);
	if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
	if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
	if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
	format(file, sizeof(file), "Accounts/%s.ini", user);
	if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
	if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
	format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
	SendClientMessageToAll(COLOR_LIGHTRED, string);
	format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
	// Prisoning
	dini_IntSet(file, "pJail", 1);
	// Prisonreason
	dini_Set(file, "pJailReason", var);
	dini_Set(file, "pJailBy", GetName(playerid));
	dini_IntSet(file, "pJailTime", time);
	return 1;
}
I want to get this working. When typing this IG nothing happens. Can anybody help me?

My LoadChar();
Код:
stock LoadChar(playerid)
{
    new file[64];
	format(file, sizeof(file), "Accounts/%s.ini", GetAccountName(playerid));
	// Logged in
	Player[playerid][pLoggedIn] = 1;
	Player[playerid][pSpawn] = 1;
	// Load
	format(Player[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
	Player[playerid][pGender] = dini_Int(file, "Gender");
	Player[playerid][pLevel] = dini_Int(file, "Level");
	if(Player[playerid][pLevel] == 0) Player[playerid][pLevel] = 1;
	Player[playerid][pMinutes] = dini_Int(file, "Minutes");
	Player[playerid][pHours] = dini_Int(file, "Hours");
	Player[playerid][pExp] = dini_Int(file, "Exp");
	Player[playerid][pAge] = dini_Int(file, "Age");
	Player[playerid][pMoney] = dini_Int(file, "Cash");
	Player[playerid][pColor] = dini_Int(file, "Color");
	Player[playerid][pBank] = dini_Int(file, "Bank");
	Player[playerid][pModel] = dini_Int(file, "Model");
	Player[playerid][pAdmin] = dini_Int(file, "Admin");
	Player[playerid][pAdminLocked] = dini_Int(file, "AdminLocked");
	Player[playerid][pGangMod] = dini_Int(file, "GangMod");
	Player[playerid][pFacMod] = dini_Int(file, "FacMod");
	Player[playerid][pBanned] = dini_Int(file, "pBanned");
	Player[playerid][pEBanned] = dini_Int(file, "pEBanned");
	Player[playerid][pX]  = dini_Float(file, "X");
	Player[playerid][pY] = dini_Float(file, "Y");
	Player[playerid][pZ] = dini_Float(file, "Z");
	Player[playerid][pInt] = dini_Int(file, "Int");
	Player[playerid][pVW] = dini_Int(file, "VW");
	Player[playerid][pxX]  = dini_Float(file, "xX");
	Player[playerid][pyY] = dini_Float(file, "yY");
	Player[playerid][pzZ] = dini_Float(file, "zZ");
	Player[playerid][pFac] = dini_Int(file, "Fac");
	Player[playerid][pFacRank] = dini_Int(file, "FacRank");
	Player[playerid][pFacLeader] = dini_Int(file, "FacLeader");
	Player[playerid][pFacDiv] = dini_Int(file, "FacDiv");
	Player[playerid][pFacDivLeader] = dini_Int(file, "FacDivLeader");
	Player[playerid][pFacDuty] = dini_Int(file, "Duty");
	Player[playerid][pWeapon][0] = dini_Int(file, "wSlot0");
	Player[playerid][pWeaponAmmo][0] = dini_Int(file, "wSlot0Ammo");
	Player[playerid][pWeapon][1] = dini_Int(file, "wSlot1");
	Player[playerid][pWeaponAmmo][1] = dini_Int(file, "wSlot1Ammo");
	Player[playerid][pWeapon][2] = dini_Int(file, "wSlot2");
	Player[playerid][pWeaponAmmo][2] = dini_Int(file, "wSlot2Ammo");
	Player[playerid][pWeapon][3] = dini_Int(file, "wSlot3");
	Player[playerid][pWeaponAmmo][3] = dini_Int(file, "wSlot3Ammo");
	Player[playerid][pWeapon][4] = dini_Int(file, "wSlot4");
	Player[playerid][pWeaponAmmo][4] = dini_Int(file, "wSlot4Ammo");
	Player[playerid][pWeapon][5] = dini_Int(file, "wSlot5");
	Player[playerid][pWeaponAmmo][5] = dini_Int(file, "wSlot5Ammo");
	Player[playerid][pWeapon][6] = dini_Int(file, "wSlot6");
	Player[playerid][pWeaponAmmo][6] = dini_Int(file, "wSlot6Ammo");
	Player[playerid][pWeapon][7] = dini_Int(file, "wSlot7");
	Player[playerid][pWeaponAmmo][7] = dini_Int(file, "wSlot7Ammo");
	Player[playerid][pWeapon][8] = dini_Int(file, "wSlot8");
	Player[playerid][pWeaponAmmo][8] = dini_Int(file, "wSlot8Ammo");
	Player[playerid][pWeapon][9] = dini_Int(file, "wSlot9");
	Player[playerid][pWeaponAmmo][9] = dini_Int(file, "wSlot9Ammo");
	Player[playerid][pWeapon][10] = dini_Int(file, "wSlot10");
	Player[playerid][pWeaponAmmo][10] = dini_Int(file, "wSlot10Ammo");
	Player[playerid][pWeapon][11] = dini_Int(file, "wSlot11");
	Player[playerid][pWeaponAmmo][11] = dini_Int(file, "wSlot11Ammo");
	Player[playerid][pWeapon][12] = dini_Int(file, "wSlot12");
	Player[playerid][pWeaponAmmo][12] = dini_Int(file, "wSlot12Ammo");
	Player[playerid][pHospital] = dini_Int(file, "Hospital");
	Player[playerid][pBiz] = dini_Int(file, "Business");
	Player[playerid][pSafeAdmin] = dini_Int(file, "HouseOwner");
	Player[playerid][pVBiz] = dini_Int(file, "VBusiness");
	Player[playerid][pOwner] = dini_Int(file, "BizOwner");
	Player[playerid][pJob] = dini_Int(file, "Job");
	Player[playerid][pJobSkill][JOB_MECHANIC] = dini_Int(file, "Mechanic");
	Player[playerid][pJobSkill][JOB_LAWYER] = dini_Int(file, "Lawyer");
	Player[playerid][pJobSkill][JOB_TRUCKER] = dini_Int(file, "Trucker");
	Player[playerid][pJobSkill][JOB_FISHER] = dini_Int(file, "Fisher");
	Player[playerid][pJobSkill][JOB_WDEALER] = dini_Int(file, "WDealer");
	Player[playerid][pJobSkill][JOB_WSMUGGLER] = dini_Int(file, "WSmuggler");
	Player[playerid][pJobSkill][JOB_DDEALER] = dini_Int(file, "DDealer");
	Player[playerid][pJobSkill][JOB_DSMUGGLER] = dini_Int(file, "DSmuggler");
	Player[playerid][pJobSkill][JOB_CARJACKER] = dini_Int(file, "CarJacker");
    Player[playerid][pJobSkill][JOB_FISHER] = dini_Int(file, "Fisher");
	Player[playerid][pTPackages] = dini_Int(file, "TPackages");
	Player[playerid][pLMPackages] = dini_Int(file, "LMPackages");
	Player[playerid][pMMPackages] = dini_Int(file, "MMPackages");
	Player[playerid][pHMPackages] = dini_Int(file, "HMPackages");
	Player[playerid][pLMaterials] = dini_Int(file, "LMaterials");
	Player[playerid][pMMaterials] = dini_Int(file, "MMaterials");
	Player[playerid][pHMaterials] = dini_Int(file, "HMaterials");
	Player[playerid][pHasCellphone] = dini_Int(file, "HasCellphone");
	Player[playerid][pBoombox] = dini_Int(file, "Boombox");
	Player[playerid][pAUXCord] = dini_Int(file, "AUX Cord");
	Player[playerid][pCDPlayer] = dini_Int(file, "MP3 Player");
	Player[playerid][pPhone] = 	dini_Int(file, "Cellphone");
	Player[playerid][pPhonebook] = 	dini_Int(file, "Phonebook");
	Player[playerid][pDice] = dini_Int(file, "Dice");
	Player[playerid][pCigar] = dini_Int(file, "Cigar");
	Player[playerid][pSpeedo] = dini_Int(file, "Speedo");
	Player[playerid][pSprunk] = dini_Int(file, "Sprunk");
	Player[playerid][pSpray] = dini_Int(file, "Spray");
	Player[playerid][pRope] = dini_Int(file, "Rope");
	Player[playerid][pBlindfold] = dini_Int(file, "Blindfold");
	Player[playerid][pMaterials] = dini_Int(file, "Materials");
 	Player[playerid][pWT] = dini_Int(file, "WT");
	Player[playerid][pWTC] = dini_Int(file, "WTC");
	Player[playerid][pGas] = dini_Int(file, "Gas");
	Player[playerid][pRadio] = dini_Int(file, "Radio");
	Player[playerid][pHealth] = dini_Float(file, "Health");
	Player[playerid][pArmor] = dini_Float(file, "Armor");
	Player[playerid][pInternet] = dini_Int(file, "Internet");
	Player[playerid][pSong][1] = dini_Int(file, "Song1");
	Player[playerid][pSong][2] = dini_Int(file, "Song2");
	Player[playerid][pJail] = dini_Int(file, "Jail");
	Player[playerid][pJailTime] = dini_Int(file, "JailTime");
	format(Player[playerid][pJailReason], 64, "%s", dini_Get(file, "JailReason"));
	format(Player[playerid][pJailBy], 32, "%s", dini_Get(file, "JailBy"));
	Player[playerid][pPrison] = dini_Int(file, "Prison");
	Player[playerid][pPrisonTime] = dini_Int(file, "PrisonTime");
	format(Player[playerid][pPrisonReason], 64, "%s", dini_Get(file, "PrisonReason"));
	format(Player[playerid][pPrisonBy], 32, "%s", dini_Get(file, "PrisonBy"));
	Player[playerid][pWanted] = dini_Int(file, "Wanted");
	format(Player[playerid][pWanted1], 64, "%s", dini_Get(file, "Wanted1"));
	format(Player[playerid][pWanted2], 64, "%s", dini_Get(file, "Wanted2"));
	format(Player[playerid][pWanted3], 64, "%s", dini_Get(file, "Wanted3"));
	format(Player[playerid][pWanted4], 64, "%s", dini_Get(file, "Wanted4"));
	format(Player[playerid][pWanted5], 64, "%s", dini_Get(file, "Wanted5"));
	format(Player[playerid][pWanted6], 64, "%s", dini_Get(file, "Wanted6"));
	Player[playerid][pCrimes] = dini_Int(file, "Crimes");
	Player[playerid][pArrested] = dini_Int(file, "Arrested");
	Player[playerid][pDPackages] = dini_Int(file, "DPackages");
	Player[playerid][pWeed] = dini_Int(file, "Weed");
	Player[playerid][pWeed] = dini_Int(file, "Weed");
	Player[playerid][pSeeds] = dini_Int(file, "Seeds");
	Player[playerid][pCocaine] = dini_Int(file, "cocaine");
	Player[playerid][pTWeed] = dini_Int(file, "TrunkWeed");
	Player[playerid][pTCocaine] = dini_Int(file, "TrunkCocaine");
	Player[playerid][pvTWeed] = dini_Int(file, "vTrunkWeed");
	Player[playerid][pvTCocaine] = dini_Int(file, "vTrunkCocaine");
	Player[playerid][pvVVTWeed] = dini_Int(file, "vVTrunkWeed");
	Player[playerid][pvVTCocaine] = dini_Int(file, "vVTrunkCocaine");
	Player[playerid][pvVVTWeed] = dini_Int(file, "vVVTrunkWeed");
	Player[playerid][pvVVTCocaine] = dini_Int(file, "vVVTrunkCocaine");
	Player[playerid][pLTMaterials] = dini_Int(file, "vLowTrunkMaterial");
	Player[playerid][pMTMaterials] = dini_Int(file, "vMediumTrunkMaterial");
	Player[playerid][pHTMaterials] = dini_Int(file, "vHighTrunkMaterial");
	Player[playerid][pvLTMaterials] = dini_Int(file, "vVLowTrunkMaterial");
	Player[playerid][pvMTMaterials] = dini_Int(file, "vVMediumTrunkMaterial");
	Player[playerid][pvHTMaterials] = dini_Int(file, "vVHighTrunkMaterial");
	Player[playerid][pvvLTMaterials] = dini_Int(file, "vVVLTrunkMaterial");
	Player[playerid][pvvMTMaterials] = dini_Int(file, "vVVMTrunkMaterial");
	Player[playerid][pvvHTMaterials] = dini_Int(file, "vVVHTrunkMaterial");
	Player[playerid][pvvvLTMaterials] = dini_Int(file, "vVVVLTrunkMaterial");
	Player[playerid][pvvvMTMaterials] = dini_Int(file, "vVVVMTrunkMaterial");
	Player[playerid][pvvvHTMaterials] = dini_Int(file, "vVVVHTrunkMaterial");
	Player[playerid][pContract] = dini_Int(file, "Contract");
	format(Player[playerid][pContractBy], 32, "%s", dini_Get(file, "ContractBy"));
	Player[playerid][pTutorial] = dini_Int(file, "Tutorial");
	Player[playerid][pWarns] = dini_Int(file, "Warns");
	format(Player[playerid][pWarn1], 64, "%s", dini_Get(file, "Warn1"));
	format(Player[playerid][pWarn2], 64, "%s", dini_Get(file, "Warn2"));
	format(Player[playerid][pWarn3], 64, "%s", dini_Get(file, "Warn3"));
	format(Player[playerid][pFlag], 64, "%s", dini_Get(file, "Flag"));
	Player[playerid][pNMute] = dini_Int(file, "NMute");
	Player[playerid][pSpawnFreeze] = dini_Int(file, "SpawnFreeze");
	Player[playerid][pFam] = dini_Int(file, "Fam");
	Player[playerid][pFamRank] = dini_Int(file, "FamRank");
	Player[playerid][pCSuccess] = dini_Int(file, "CSuccess");
	Player[playerid][pMask] = dini_Int(file, "Mask");
	Player[playerid][pMasked] = dini_Int(file, "Masked");
	Player[playerid][pCFail] = dini_Int(file, "CFail");
	Player[playerid][pHouse] = dini_Int(file, "House");
	Player[playerid][pVHouse] = dini_Int(file, "vHouse");
	Player[playerid][pGarage] = dini_Int(file, "Garage");
	Player[playerid][pVGarage] = dini_Int(file, "VGarage");
	Player[playerid][pHelper] = dini_Int(file, "Helper");
	Player[playerid][pNWarns] = dini_Int(file, "NWarns");
	Player[playerid][pRWarns] = dini_Int(file, "RWarns");
	Player[playerid][pRMute] = dini_Int(file, "RMute");
	Player[playerid][pDead] = dini_Int(file, "pDead");
	Player[playerid][pRadarGun] = dini_Int(file, "pRadarGun");
	Player[playerid][pFamed] = dini_Int(file, "Famed");
	Player[playerid][pFamedPoints] = dini_Int(file, "FamedPoints");
	Player[playerid][pMapper] = dini_Int(file, "Mapper");
	Player[playerid][pScripters] = dini_Int(file, "scripter");
	Player[playerid][pStaffObserver] = dini_Int(file, "Moderator");
	Player[playerid][pGangMod] = dini_Int(file, "GangMod");
	Player[playerid][pFacMod] = dini_Int(file, "FacMod");
	Player[playerid][pBanAppealer] = dini_Int(file, "BanAppealer");
	Player[playerid][pCarLic] = dini_Int(file, "CarLicense");
	format(Player[playerid][pAccent], 16, "%s", dini_Get(file, "Accent"));
	Player[playerid][pVIP] = dini_Int(file, "VIP");
	Player[playerid][pVIPPoints] = dini_Int(file, "VIPPoints");
	Player[playerid][pVIPBuddy] = dini_Int(file, "VIPBuddy");
	Player[playerid][pVIPDay] = dini_Int(file, "VIPDay");
	Player[playerid][pVIPMonth] = dini_Int(file, "VIPMonth");
	Player[playerid][pVIPHour] = dini_Int(file, "VIPDayHour");
	Player[playerid][pVIPTemp] = dini_Int(file, "VIPTemp");
	Player[playerid][vSpawnX] = dini_Float(file, "vSpawnX");
	Player[playerid][vSpawnY] = dini_Float(file, "vSpawnY");
	Player[playerid][vSpawnZ] = dini_Float(file, "vSpawnZ");
	Player[playerid][pVIPJob] = dini_Int(file, "VIPJob");
	Player[playerid][pDeliverTruck] = dini_Int(file, "DeliverTruck");
	Player[playerid][pNew] = dini_Int(file, "New");
	Player[playerid][pRefPoints] = dini_Int(file, "RefPoints");
	Player[playerid][pTester] = dini_Int(file, "Tester");
	Player[playerid][pFightStyle] = dini_Int(file, "FightStyle");
	SetPlayerFightingStyle(playerid, Player[playerid][pFightStyle]);
	Player[playerid][pScope] = dini_Int(file, "Scope");
	Player[playerid][pCookie] = dini_Int(file, "Cookie");
	Player[playerid][pOldskool] = dini_Int(file, "Oldskool");
	Player[playerid][pReward] = dini_Int(file, "Reward");
	Player[playerid][pFish][0] = dini_Int(file, "Fish1");
	Player[playerid][pFish][1] = dini_Int(file, "Fish2");
	Player[playerid][pFish][2] = dini_Int(file, "Fish3");
	Player[playerid][pFish][3] = dini_Int(file, "Fish4");
	Player[playerid][pFish][4] = dini_Int(file, "Fish5");
	Player[playerid][pFlyLic] = dini_Int(file, "FlyLic");
	Player[playerid][pFishLic] = dini_Int(file, "FishLic");
	Player[playerid][pGunLic] = dini_Int(file, "GunLic");
	Player[playerid][pWalk] = dini_Int(file, "Walk");
 	// First Car
    Player[playerid][vModel] = dini_Int(file, "vModel");
  	Player[playerid][vX] = dini_Float(file, "vX");
	Player[playerid][vY] = dini_Float(file, "vY");
	Player[playerid][vZ] = dini_Float(file, "vZ");
	Player[playerid][vA] = dini_Float(file, "vA");
	Player[playerid][vC1] = dini_Int(file, "vC1");
	Player[playerid][vC2] = dini_Int(file, "vC2");
	Player[playerid][vPJ] = dini_Int(file, "vPJ");
	Player[playerid][vLocked] = dini_Int(file, "vLocked");
	Player[playerid][pVehMod][0] = dini_Int(file, "vModSlot0");
	Player[playerid][pVehMod][1] = dini_Int(file, "vModSlot1");
	Player[playerid][pVehMod][2] = dini_Int(file, "vModSlot2");
	Player[playerid][pVehMod][3] = dini_Int(file, "vModSlot3");
	Player[playerid][pVehMod][4] = dini_Int(file, "vModSlot4");
	Player[playerid][pVehMod][5] = dini_Int(file, "vModSlot5");
	Player[playerid][pVehMod][6] = dini_Int(file, "vModSlot6");
	Player[playerid][pVehMod][7] = dini_Int(file, "vModSlot7");
	Player[playerid][pVehMod][8] = dini_Int(file, "vModSlot8");
	Player[playerid][pVehMod][9] = dini_Int(file, "vModSlot9");
	Player[playerid][pVehMod][10] = dini_Int(file, "vModSlot10");
	Player[playerid][pVehMod][11] = dini_Int(file, "vModSlot11");
	Player[playerid][pVehMod][12] = dini_Int(file, "vModSlot12");
	Player[playerid][pVehMod][13] = dini_Int(file, "vModSlot13");
	// Second Car
	Player[playerid][vVModel] = dini_Int(file, "vVModel");
	Player[playerid][vVX] = dini_Float(file, "vVX");
	Player[playerid][vVY] = dini_Float(file, "vVY");
	Player[playerid][vVZ] = dini_Float(file, "vVZ");
	Player[playerid][vVA] = dini_Float(file, "vVA");
	Player[playerid][vVC1] = dini_Int(file, "vVC1");
	Player[playerid][vVC2] = dini_Int(file, "vVC2");
	Player[playerid][vVPJ] = dini_Int(file, "vVPJ");
	Player[playerid][vVLocked] = dini_Int(file, "vVLocked");
	Player[playerid][pVVehMod][0] = dini_Int(file, "vVModSlot0");
	Player[playerid][pVVehMod][1] = dini_Int(file, "vVModSlot1");
	Player[playerid][pVVehMod][2] = dini_Int(file, "vVModSlot2");
	Player[playerid][pVVehMod][3] = dini_Int(file, "vVModSlot3");
	Player[playerid][pVVehMod][4] = dini_Int(file, "vVModSlot4");
	Player[playerid][pVVehMod][5] = dini_Int(file, "vVModSlot5");
	Player[playerid][pVVehMod][6] = dini_Int(file, "vVModSlot6");
	Player[playerid][pVVehMod][7] = dini_Int(file, "vVModSlot7");
	Player[playerid][pVVehMod][8] = dini_Int(file, "vVModSlot8");
	Player[playerid][pVVehMod][9] = dini_Int(file, "vVModSlot9");
	Player[playerid][pVVehMod][10] = dini_Int(file, "vVModSlot10");
	Player[playerid][pVVehMod][11] = dini_Int(file, "vVModSlot11");
	Player[playerid][pVVehMod][12] = dini_Int(file, "vVModSlot12");
	Player[playerid][pVVehMod][13] = dini_Int(file, "vVModSlot13");
	// Third Car
	Player[playerid][vVVModel] = dini_Int(file, "vVVModel");
	Player[playerid][vVVX] = dini_Float(file, "vVVX");
	Player[playerid][vVVY] = dini_Float(file, "vVVY");
	Player[playerid][vVVZ] = dini_Float(file, "vVVZ");
	Player[playerid][vVVA] = dini_Float(file, "vVVA");
	Player[playerid][vVVC1] = dini_Int(file, "vVVC1");
	Player[playerid][vVVC2] = dini_Int(file, "vVVC2");
	Player[playerid][vVVPJ] = dini_Int(file, "vVVPJ");
	Player[playerid][vVVLocked] = dini_Int(file, "vVVLocked");
	Player[playerid][pVVVehMod][0] = dini_Int(file, "vVVModSlot0");
	Player[playerid][pVVVehMod][1] = dini_Int(file, "vVVModSlot1");
	Player[playerid][pVVVehMod][2] = dini_Int(file, "vVVModSlot2");
	Player[playerid][pVVVehMod][3] = dini_Int(file, "vVVModSlot3");
	Player[playerid][pVVVehMod][4] = dini_Int(file, "vVVModSlot4");
	Player[playerid][pVVVehMod][5] = dini_Int(file, "vVVModSlot5");
	Player[playerid][pVVVehMod][6] = dini_Int(file, "vVVModSlot6");
	Player[playerid][pVVVehMod][7] = dini_Int(file, "vVVModSlot7");
	Player[playerid][pVVVehMod][8] = dini_Int(file, "vVVModSlot8");
	Player[playerid][pVVVehMod][9] = dini_Int(file, "vVVModSlot9");
	Player[playerid][pVVVehMod][10] = dini_Int(file, "vVVModSlot10");
	Player[playerid][pVVVehMod][11] = dini_Int(file, "vVVModSlot11");
	Player[playerid][pVVVehMod][12] = dini_Int(file, "vVVModSlot12");
	Player[playerid][pVVVehMod][13] = dini_Int(file, "vVVModSlot13");
	// Fourth Car
	Player[playerid][vVVVModel] = dini_Int(file, "vVVVModel");
	Player[playerid][vVVVX] = dini_Float(file, "vVVVX");
	Player[playerid][vVVVY] = dini_Float(file, "vVVVY");
	Player[playerid][vVVVZ] = dini_Float(file, "vVVVZ");
	Player[playerid][vVVVA] = dini_Float(file, "vVVVA");
	Player[playerid][vVVVC1] = dini_Int(file, "vVVVC1");
	Player[playerid][vVVVC2] = dini_Int(file, "vVVVC2");
	Player[playerid][vVVVPJ] = dini_Int(file, "vVVVPJ");
	Player[playerid][vVVVLocked] = dini_Int(file, "vVVVLocked");
	Player[playerid][pVVVVehMod][0] = dini_Int(file, "vVVVModSlot0");
	Player[playerid][pVVVVehMod][1] = dini_Int(file, "vVVVModSlot1");
	Player[playerid][pVVVVehMod][2] = dini_Int(file, "vVVVModSlot2");
	Player[playerid][pVVVVehMod][3] = dini_Int(file, "vVVVModSlot3");
	Player[playerid][pVVVVehMod][4] = dini_Int(file, "vVVVModSlot4");
	Player[playerid][pVVVVehMod][5] = dini_Int(file, "vVVVModSlot5");
	Player[playerid][pVVVVehMod][6] = dini_Int(file, "vVVVModSlot6");
	Player[playerid][pVVVVehMod][7] = dini_Int(file, "vVVVModSlot7");
	Player[playerid][pVVVVehMod][8] = dini_Int(file, "vVVVModSlot8");
	Player[playerid][pVVVVehMod][9] = dini_Int(file, "vVVVModSlot9");
	Player[playerid][pVVVVehMod][10] = dini_Int(file, "vVVVModSlot10");
	Player[playerid][pVVVVehMod][11] = dini_Int(file, "vVVVModSlot11");
	Player[playerid][pVVVVehMod][12] = dini_Int(file, "vVVVModSlot12");
	Player[playerid][pVVVVehMod][13] = dini_Int(file, "vVVVModSlot13");
	// Upgrade Points
	Player[playerid][pUpgradePoints] = dini_Int(file, "UpgradePoints");
	Player[playerid][pArmorUpgrade] = dini_Int(file, "ArmorUpgrade");
	Player[playerid][pHealthUpgrade] = dini_Int(file, "HealthUpgrade");
	// Gates
	Player[playerid][pGate][0] = dini_Int(file, "Gate1");
	Player[playerid][pGate][1] = dini_Int(file, "Gate2");
	Player[playerid][pGate][2] = dini_Int(file, "Gate3");
	// Special Tag
	format(Player[playerid][pTag], 32, "%s", dini_Get(file, "Tag"));
	// Special Name
	format(Player[playerid][pSName], 32, "%s", dini_Get(file, "SName"));
	// Special Weapon
    Player[playerid][pSpecialWeapon] = dini_Int(file, "SpecialWeapon");
	if(Player[playerid][vModel])
	{
	    Player[playerid][pVeh] = CreateVehicle(Player[playerid][vModel], Player[playerid][vX],Player[playerid][vY],Player[playerid][vZ],Player[playerid][vA],Player[playerid][vC1],Player[playerid][vC2],1200);
        ChangeVehiclePaintjob(Player[playerid][pVeh], Player[playerid][vPJ]);
        if(Player[playerid][vLocked]) SetVehicleParamsEx(Player[playerid][pVeh], 0, 0, 0, 1, 0, 0, 0);
        for(new i=0; i<14; i++)
		{
		    AddVehicleComponent(Player[playerid][pVeh], Player[playerid][pVehMod][i]);
		}
	}
	if(Player[playerid][vVModel])
	{
        //DestroyVehicle(Player[playerid][pVVeh]);
	    Player[playerid][pVVeh] = CreateVehicle(Player[playerid][vVModel], Player[playerid][vVX],Player[playerid][vVY],Player[playerid][vVZ],Player[playerid][vVA],Player[playerid][vVC1],Player[playerid][vVC2],1200);
	    //Player[playerid][pVVeh] = SetVehicleToRespawn(Player[playerid][vVModel]);
	    //vehicle2timer = SetTimerEx("car2",5000,true,"i",playerid);
        ChangeVehiclePaintjob(Player[playerid][pVVeh], Player[playerid][vVPJ]);
        if(Player[playerid][vVLocked]) SetVehicleParamsEx(Player[playerid][pVVeh], 0, 0, 0, 1, 0, 0, 0);
        for(new i=0; i<14; i++)
		{
		    AddVehicleComponent(Player[playerid][pVVeh], Player[playerid][pVVehMod][i]);
		}
	}
	if(Player[playerid][vVVModel])
	{
        //DestroyVehicle(Player[playerid][pVVVeh]);
	    Player[playerid][pVVVeh] =  CreateVehicle(Player[playerid][vVVModel], Player[playerid][vVVX],Player[playerid][vVVY],Player[playerid][vVVZ],Player[playerid][vVVA],Player[playerid][vVVC1],Player[playerid][vVVC2],1200);
	    //Player[playerid][pVVVeh] = SetVehicleToRespawn(Player[playerid][vVVModel]);
	    //vehicle3timer = SetTimerEx("car3",5000,true,"i",playerid);
        ChangeVehiclePaintjob(Player[playerid][pVVVeh], Player[playerid][vVVPJ]);
        if(Player[playerid][vVVLocked]) SetVehicleParamsEx(Player[playerid][pVVVeh], 0, 0, 0, 1, 0, 0, 0);
        for(new i=0; i<14; i++)
		{
		    AddVehicleComponent(Player[playerid][pVVVeh], Player[playerid][pVVVehMod][i]);
		}
	}
	if(Player[playerid][vVVVModel])
	{
        //DestroyVehicle(Player[playerid][pVVVVeh]);
	    Player[playerid][pVVVVeh] =  CreateVehicle(Player[playerid][vVVVModel], Player[playerid][vVVVX],Player[playerid][vVVVY],Player[playerid][vVVVZ],Player[playerid][vVVVA],Player[playerid][vVVVC1],Player[playerid][vVVVC2],1200);
	    //vehicle4timer = SetTimerEx("car4",5000,true,"i",playerid);
        ChangeVehiclePaintjob(Player[playerid][pVVVVeh], Player[playerid][vVVVPJ]);
        if(Player[playerid][vVVVLocked]) SetVehicleParamsEx(Player[playerid][pVVVVeh], 0, 0, 0, 1, 0, 0, 0);
        for(new i=0; i<14; i++)
		{
		    AddVehicleComponent(Player[playerid][pVVVVeh], Player[playerid][pVVVVehMod][i]);
		}
	}
	LoadToys(playerid, file);
	// All Loaded
	print("Character file loaded successfuly.");
	new string[256];
	// Player
	format(string, sizeof(string), "* Welcome to International Roleplay %s, Your last login was from %s.", GetName(playerid), Player[playerid][pIP]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    // Helper Messages
    if(Player[playerid][pHelper])
	{
        format(string, sizeof(string), "HelperLogin: %s %s has logged in.", RPHLN(playerid), GetName(playerid));
        SendHelperMessage(COLOR_ADMWARN, string);
	}
	if(Player[playerid][pStaffObserver])
	{
        format(string, sizeof(string), "StaffLogin: %s %s has logged in.", RPMODLN(playerid), GetName(playerid));
        StaffWarn(COLOR_SWARN, string);
	}
   /* foreach(Player, i)
	{
	    if(Logged(i))
	    {
	      if(Player[playerid][pAdmin] == 2) ShowPlayerNameTagForPlayer(i, playerid, false);
          if(Player[playerid][pAdmin] == 3) ShowPlayerNameTagForPlayer(i, playerid, false);
          if(Player[playerid][pAdmin] == 4) ShowPlayerNameTagForPlayer(i, playerid, false);
	      if(Player[playerid][pAdmin] == 1337) ShowPlayerNameTagForPlayer(i, playerid, false);
	      if(Player[playerid][pAdmin] == 1338) ShowPlayerNameTagForPlayer(i, playerid, false);
	      if(Player[playerid][pAdmin] == 100000) ShowPlayerNameTagForPlayer(i, playerid, false);
	   }
    }
	if(IsValidDynamic3DTextLabel(aAdminText[playerid])) DestroyDynamic3DTextLabel(aAdminText[playerid]);
	if(Player[playerid][pAdmin] == 2) aAdminText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -24, 29, playerid);
    if(Player[playerid][pAdmin] == 3) aAdminText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -24, 29, playerid);
    if(Player[playerid][pAdmin] == 4) aAdminText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -24, 29, playerid);
    if(Player[playerid][pAdmin] == 1337) aAdminText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -24, 29, playerid);
    if(Player[playerid][pAdmin] == 1338) aAdminText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -24, 29, playerid);
    if(Player[playerid][pAdmin] == 100000) aAdminText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -24, 29, playerid);
	fa(STREAMER_TYPE_3D_TEXT_LABEL, aAdminText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.29);*/
    if(Player[playerid][pAdmin])
	{
    	format(string, sizeof(string), "AdminLogin: %s %s has logged in.", RPALN(playerid), GetName(playerid));
        SendAdminMessage(COLOR_ADMWARN,  string);
        format(string, sizeof(string), "Admin Motd: %s", ADMINMOTD);
        SendClientMessage(playerid, COLOR_ADMWARN,  string);
	}
	if(Player[playerid][pAdminLocked])
	{
    	format(string, sizeof(string), "AdminWarning: Your account is locked by an administrator.");
        SendClientMessage(playerid, COLOR_ADMWARN,  string);
        Kick(playerid);

	}
    // Families & Factions MOTDs
    if(strlen(FamInfo[Player[playerid][pFam]][fMOTD]) > 0)
	{
    	format(string, sizeof(string), "FAMILY MOTD: %s", FamInfo[Player[playerid][pFam]][fMOTD]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
	}
	return 1;
}
Post a working command here please.
Reply
#2

I will not "post a working command here", but what you could do on your own to figure out the faulty spot is adding debug messages into your script (or use jernejl's plugin for that matter)
You could add debug messages e.g. like this:
Код:
IRP:oprison(playerid, var[])
{
    printf("Called command");
    new user[32], string[128], file[32], time;
   	if(!Logged(playerid)) return NoLogin(playerid);
        printf("Player is logged in");
	if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
     printf("Player has required admin rights");
	if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
	if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
	format(file, sizeof(file), "Accounts/%s.ini", user);
	if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
	if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
	format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
	SendClientMessageToAll(COLOR_LIGHTRED, string);
	format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
	// Prisoning
	dini_IntSet(file, "pJail", 1);
	// Prisonreason
	dini_Set(file, "pJailReason", var);
	dini_Set(file, "pJailBy", GetName(playerid));
	dini_IntSet(file, "pJailTime", time);
	return 1;
}
the 3 "printf"s are just examples, but they will show you which parts are getting called and which aren't...


BTW you know the existance of the "Edit" button? Should use it and not create multiple topics for the same subject. More threads will not get your more help and rather less qualified help
Reply
#3

Quote:
Originally Posted by Sascha
Посмотреть сообщение
I will not "post a working command here", but what you could do on your own to figure out the faulty spot is adding debug messages into your script (or use jernejl's plugin for that matter)
You could add debug messages e.g. like this:
Код:
IRP:oprison(playerid, var[])
{
    printf("Called command");
    new user[32], string[128], file[32], time;
   	if(!Logged(playerid)) return NoLogin(playerid);
        printf("Player is logged in");
	if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
     printf("Player has required admin rights");
	if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
	if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
	format(file, sizeof(file), "Accounts/%s.ini", user);
	if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
	if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
	format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
	SendClientMessageToAll(COLOR_LIGHTRED, string);
	format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
	// Prisoning
	dini_IntSet(file, "pJail", 1);
	// Prisonreason
	dini_Set(file, "pJailReason", var);
	dini_Set(file, "pJailBy", GetName(playerid));
	dini_IntSet(file, "pJailTime", time);
	return 1;
}
the 3 "printf"s are just examples, but they will show you which parts are getting called and which aren't...


BTW you know the existance of the "Edit" button? Should use it and not create multiple topics for the same subject. More threads will not get your more help and rather less qualified help
I need the fixed code, not how to fix it if possible.
Reply
#4

IRP:oprison(playerid, var[])

Shouldn't it be CMD:?

Also debug your code as said above. This section isn't for requests.
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
IRP:oprison(playerid, var[])

Shouldn't it be CMD:?

Also debug your code as said above. This section isn't for requests.
1) No, I've got own CMD processor.
2) I dont understand how really, I never de-bugged something in PAWN, if possible give instructions (steps) how to do it and what to do when I get results.
3) Exactly, it's for help.
4) Please give me steps what to do and if something is missing in code please tell me where to input it and how.

Thanks in advance.
Reply
#6

Just add lines of "print" after something is executed.

For example:
pawn Код:
IRP:oprison(playerid, var[])
{
    printf("1");
    new user[32], string[128], file[32], time;
    printf("2");
    if(!Logged(playerid)) return NoLogin(playerid);
    printf("3");
    if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
    printf("4");
    if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
    printf("5");
    if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
    printf("6");
    format(file, sizeof(file), "Accounts/%s.ini", user);
    printf("7");
    if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
    printf("8");
    if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
    printf("9");
    format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
    printf("10");
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    printf("11");
    format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
    printf("12");
    // Prisoning
    dini_IntSet(file, "pJail", 1);
    printf("13");
    // Prisonreason
    dini_Set(file, "pJailReason", var);
    printf("14");
    dini_Set(file, "pJailBy", GetName(playerid));
    printf("15");
    dini_IntSet(file, "pJailTime", time);
    printf("16");
    return 1;
}
Check the command console and see at which number it ends on.
Reply
#7

This is your third thread about the same command. Do not create new threads just because your old one is unanswered.

I will help you since you seem so desperate, but as stated by previous comments, this is not for requests. This section is for requesting help when you're stuck at a problem.

Here, you don't even seem to have tried figuring the fault out, since it's very easy.

- Your command jails a player who's offline by adding values to variables in the players .ini file.
- When the player logs in, those variables are converted into an array called Player[][Jail] etc.
- Your problem is, that neither your PrisonTimer, LoadChar or the /oprison does set the players position.

Solution:
- Either you change the variables X, Y, and Z in the player .ini file on /oprison
- Set an "if" statement on your LoadChar();, checking if the player has been jailed offline, then set the player's position to the jailpos.
- Repeatedly set the players position on your PrisonTimer. This is optimal if you really want the player to suffer in the jail and not be able to move, since he's going to be stuck at the same position every second (or whatever refresh you have on the timer).

I would personally set the players position in the .ini file directly when /oprison.
pawn Код:
IRP:oprison(playerid, var[])
{
    printf("Called command");
    new user[32], string[128], file[32], time;
    if(!Logged(playerid)) return NoLogin(playerid);
        printf("Player is logged in");
    if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
     printf("Player has required admin rights");
    if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
    if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
    format(file, sizeof(file), "Accounts/%s.ini", user);
    if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
    if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
    format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
    // Prisoning
    dini_IntSet(file, "pJail", 1);
    // Prisonreason
    dini_Set(file, "pJailReason", var);
    dini_Set(file, "pJailBy", GetName(playerid));
    dini_IntSet(file, "pJailTime", time);
        dini_FloatSet(file, "X", jailPosX);  // Change to X coords
        dini_FloatSet(file, "Y", jailPosY); // Change to Y coords
        dini_FloatSet(file, "Z", jailPosZ); // Change to Z coords
    return 1;
}
Reply
#8

I used SickAttack's method, it printed
1
2
3
etc. in the log file, till the 16. I'm trying entrozen's now
Reply
#9

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
I used SickAttack's method, it printed
1
2
3
etc. in the log file, till the 16. I'm trying entrozen's now
Then everything is executing. You just aren't jailing the player.
Reply
#10

Alright, and where do I put JailPosX, JailPosY and JailPosZ because it's giving me errors.

And should I add dini_Close or something?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)