Property commands won't work
#1

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;
}
Reply
#2

Bump
Reply
#3

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)