[HELP]OnPlayerEnterDynamicCP problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]OnPlayerEnterDynamicCP problem (
/showthread.php?tid=270455)
[HELP]OnPlayerEnterDynamicCP problem -
Gazmull - 20.07.2011
I'm starting creating a house system, now i'm at 27% of it.
But this code has bug:
pawn Код:
if(HouseInfo[J][Owned] == 0)
{
format(str, sizeof(str), "~b~Owner: ~w~%s~n~~b~Value: ~w~$%d ~n~~n~~p~House CMDs~n~~w~/buy", HouseNoOwnerName, HouseInfo[J][HouseValue]);
}
TextDrawSetString(Text:hInfo, str);
TextDrawShowForPlayer(playerid, Text:hBox);
TextDrawShowForPlayer(playerid, Text:hInfo);
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(strcmp(Pname, HouseInfo[J][Owner]) == 0) return 0;
if(strcmp(Pname, HouseInfo[J][Owner]) == 1)
{
SetPlayerPos(playerid, HouseInfo[J][TeleX], HouseInfo[J][TeleY], HouseInfo[J][TeleZ]);
SetPlayerInterior(playerid, HouseInfo[J][Interior]);
InHouse[playerid] = J;
SetPlayerVirtualWorld(playerid, HouseInfo[J][Virtual]);
TextDrawSetString(Text:hInfo, "~w~You have entered in your ~n~~g~house~n~~n~type ~y~/hinfo~w~ for info");
TextDrawShowForPlayer(playerid, Text:hInfo);
TextDrawShowForPlayer(playerid, Text:hBox);
return 1;
}
Even if i put
it doesn't work.
Sorry i'm noob in house system scripting.
EDIT:
the problem is that i don't own yet the house, i can enter... :\
but if i changed "if(strcmp(...))" to "if(!strcmp(.....))" still have same problem but /buy it works fine.
Please help
Re: [HELP]OnPlayerEnterDynamicCP problem -
Vince - 20.07.2011
pawn Код:
if(strcmp(Pname, HouseInfo[J][Owner]) == 1)
Is WRONG! strcmp returns
0 on success (i.e. when the two names are the same), not 1.
Re: [HELP]OnPlayerEnterDynamicCP problem -
Gazmull - 20.07.2011
Then, i will remove it or change?