17.04.2010, 17:51
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
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
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;
}
This is probaly just a small failure i made but it annoys me i cannot seem to find the problem. Neither the solution