SA-MP Forums Archive
Property commands won't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Property commands won't work (/showthread.php?tid=649017)



Property commands won't work - ItzColaBoi - 01.02.2018

So i have these two commands with which i can lock my property and unlock it.They seem alright to me but still when i do lockprop it just doesnt lock it.Help me out please.

Код:
CMD:lockprop(playerid, params[])
{
	new playername[25], giveplayer[25], tmp2[256], temp2;
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	if (areatype[playerarea[playerid]][0] != AREA_TYPE_PROP) return SendClientMessage2(playerid, COLOR_RED, "You must be at your property to lock it!");
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	if (areatype[playerarea[playerid]][1] != dini_Int(AddDirFile(dir_userfiles, playername), "propowned")) return SendClientMessage2(playerid, COLOR_RED, "You do not own this property!");
	format(giveplayer, 10, "PROP%d", areatype[playerarea[playerid]][1]);
	if(!dini_Isset(AddDirFile(dir_propfiles, giveplayer), "interior")) return SendClientMessage(playerid, COLOR_RED,"Your Prop Doesnt Have An Interior.");
	temp2 = dini_Int(AddDirFile(dir_propfiles, giveplayer), "interior");
	format(tmp2, sizeof(tmp2), "propint%d", temp2);
	//if(dini_Int(AddDirFile(dir_propints, tmp2), "Locked")==1) return SendClientMessage(playerid, COLOR_RED, "Error:{FFFFFF}You Have Already Locked Your Prop.");
	if(dini_Isset(AddDirFile(dir_propints, tmp2), "Locked")) return SendClientMessage2(playerid, COLOR_RED, "You Have Already Locked Your Prop.");
	dini_IntSet(AddDirFile(dir_propints, tmp2), "Locked", 1);
 	GameTextForPlayer(playerid, "~p~Property Locked", 5000, 3);
	return 1;
}
CMD:unlockprop(playerid, params[])
{
	new playername[25], giveplayer[25], tmp2[256], temp2;
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	if (areatype[playerarea[playerid]][0] != AREA_TYPE_PROP) return SendClientMessage2(playerid, COLOR_RED, "You must be at your property to lock it!");
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	if (areatype[playerarea[playerid]][1] != dini_Int(AddDirFile(dir_userfiles, playername), "propowned")) return SendClientMessage2(playerid, COLOR_RED, "You do not own this property!");
	format(giveplayer, 10, "PROP%d", areatype[playerarea[playerid]][1]);
	if(!dini_Isset(AddDirFile(dir_propfiles, giveplayer), "interior")) return SendClientMessage(playerid, COLOR_RED,"Your Prop Doesnt Have An Interior.");
	temp2 = dini_Int(AddDirFile(dir_propfiles, giveplayer), "interior");
	format(tmp2, sizeof(tmp2), "propint%d", temp2);
	//if(dini_Int(AddDirFile(dir_propints, tmp2), "Locked")==0) return SendClientMessage(playerid, COLOR_RED, "Error:{FFFFFF}You Have Already UnLocked Your Prop.");
	//dini_IntSet(AddDirFile(dir_propints, tmp2), "Locked", 0);
 	if(!dini_Isset(AddDirFile(dir_propints, tmp2), "Locked")) return SendClientMessage2(playerid, COLOR_RED, "You Have Already UnLocked Your Prop.");
	dini_Unset(AddDirFile(dir_propints, tmp2), "Locked");
 	GameTextForPlayer(playerid, "~p~Property unLocked", 5000, 3);
	return 1;
}



Re: Property commands won't work - ItzColaBoi - 02.02.2018

Bump


Re: Property commands won't work - jasperschellekens - 02.02.2018

You dont provide us with many information. what does not work exactly? With this little information provided helping is hard..


Re: Property commands won't work - ItzColaBoi - 02.02.2018

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
You dont provide us with many information. what does not work exactly? With this little information provided helping is hard..
They don't work properly.Basically when i make a property and add the interior marker i can't get in (Im supposed to be able to get in and prop should be unlocked if no one owns the prop).So i locked the prop and i was able to get in,and so is the same with unlocking.