Annoying thing -
Desert - 17.04.2010
Well i was working on a dynamic house system for my script and started working on it. But after a short time i could see a more practical way in a tutorial. So i made a system working the same as the tut. But not a copy tho.
So everything works great exept my /exit command which is as following
pawn Код:
dcmd_exit(playerid,params[])
{
#pragma unused params
if(pi[playerid][inhouse] == 0)
{
if(insidebank[playerid] == 1)
{
SetPlayerPos(playerid,2474.4392,1021.5384,10.8203);
SetPlayerFacingAngle(playerid,177.6387);
SetCameraBehindPlayer(playerid);
insidebank[playerid] = 0;
DisablePlayerCheckpoint(playerid);
}
else return SendClientMessage(playerid,COLOUR_RED,"Error: You are not in the bank or in a house");
}
else
{
new hid = IsPlayerInRangeOfHouse(playerid);
new name[MAX_PLAYER_NAME],string[MAX_PLAYER_NAME+10];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%sInHouse",name);
SetPlayerPos(playerid,hi[hid][housex],hi[hid][housey],hi[hid][housez]);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid,COLOUR_WHITE,"You have left the house");
pi[playerid][inhouse] = 0;
dini_IntSet("PlayerFiles.ini",string,0);
}
return 1;
}
Now as you might see it works both for leaving the bank or leaving a dynamic house. I recieve no errors but i get a "SERVER: Unknown command" when using it ingame. Which makes me wonder when im not using any return 0;'s in the command. And yes i have made the dcmd function under onplayercommandtext and set it's length to 4.
This is probaly just a small failure i made but it annoys me i cannot seem to find the problem. Neither the solution
Re: Annoying thing -
¤Adas¤ - 17.04.2010
Show us your OnPlayerCMDText and your dcmd macro.
Re: Annoying thing -
Desert - 17.04.2010
dcmd(exit,4,cmdtext);
And if you mean the IsPlayerInRangeOfHouse then i know for sure it works. Never been a problem with it
Re: Annoying thing -
¤Adas¤ - 17.04.2010
Okay, now show your DCMD definition... Only to check.
Re: Annoying thing -
Desert - 17.04.2010
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
But this is not the problem either as all other works fine.
Other note:
I made some bug testing on the command sending messages at all points. This showed me that the part setting you outside the house is being called. But instead of doing what it's supposed to(exept sending debug text) it says the unknown command thing. This information has left me with a big question marker of why the rest of the text is not doing nothing
Re: Annoying thing -
¤Adas¤ - 17.04.2010
Show the lines, where it breaks. It will be good clue.
Re: Annoying thing -
Desert - 17.04.2010
I did another debug test on the specific things there and found out the functions malfunction at this line
SetPlayerPos(playerid,hi[hid][housex],hi[hid][housey],hi[hid][housez]);
And now im asking for suggestions how to make it work. I have already tried saving them into new floats and set the pos to them. Didn't help
Re: Annoying thing -
¤Adas¤ - 17.04.2010
I am almost sure, that it is because variable "hid" is lower than zero! Check your "IsPlayerInRangeOfHouse" function.
Re: Annoying thing -
Desert - 17.04.2010
Thanks man made me realise the stupid mistake causing it. Gonna do some editing and it should be working
Re: Annoying thing -
¤Adas¤ - 17.04.2010
Quote:
Originally Posted by Desert
Thanks man made me realise the stupid mistake causing it. Gonna do some editing and it should be working
|
no problem, HAND

variable indexes cannot be lower than 0