09.10.2013, 23:33
Hello when i exit the interior i spawn in some where else but i am suppose to be in lspd after exiting it
Please help me
here is my code:
Images of the bug:
http://i39.tinypic.com/2ng762b.png
http://i41.tinypic.com/spx2rc.png
Help me please
Please help me
here is my code:
pawn Код:
new Float:PrisonSpawn[4][4] =
{
{215.3656,110.1666,999.0156},
{223.6761,110.4839,999.0156},
{227.6406,110.6463,999.0156},
{215.3656,110.1666,999.0156}
};
pawn Код:
@Release(playerid);
@Release(playerid)
{
new Time = GetPVarInt(playerid, "JailTime");
if(!IsPlayerConnected(playerid))
return 0;
if(Time < 1)
{
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid, 246.1763,86.3909,1003.6406);
SetPlayerFacingAngle(playerid, 180.1451);
return SendClientMessage(playerid,-1,"You're free");
}
new str[30];
format(str, sizeof(str), "You will be released in: %d", Time);
GameTextForPlayer(playerid, str, 2500, 3); // Change it if you want
SetPVarInt(playerid, "JailTime", Time - 1); // Decrease the player's jail time
SetTimerEx("@Release", 1000, false, "i", playerid);
return 1;
}
pawn Код:
CMD:ar(playerid,params[])
{
new targetid;
new string[128];
if(sscanf(params, "u", targetid))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /ar (Player Name/ID)");
return 1;
}
if(gTeam[playerid] != Team_Cop)
{
SendClientMessage(playerid,COLOR_ERROR,"Only law enforcement can arrest wanted suspects.");
return 1;
}
if(!IsPlayerConnected(targetid))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot arrest them.",targetid);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(GetDistanceBetweenPlayers(playerid,targetid) > 4)
{
format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to arrest him.",GetName(targetid),targetid);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect while in a vehicle. Exit the vehicle first.");
return 1;
}
if(GetPlayerState(targetid) == PLAYER_STATE_DRIVER || GetPlayerState(targetid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot arrest a suspect they are in a vehicle. Get them to exit the vehicle first.");
return 1;
}
new pwl = GetPlayerWantedLevel(targetid);
if(pwl == 0)
{
GivePlayerMoney(playerid, 3000);
IncreaseScore(playerid, 1);
IncreaseCoprank(playerid, 1);
SetPVarInt(targetid, "JailTime", 45);
SetPlayerInterior(targetid, 10);
new rnd = random(sizeof(PrisonSpawn));
SetPlayerPos(targetid, PrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
SendClientMessage(targetid, COLOR_GREY, "**LOS SANTOS PRISON**");
SendClientMessage(targetid, COLOR_LIGHTBLUE, "[PRISON] You have been sent to prison. You will be released soon.");
TogglePlayerControllable(targetid, 1);
SetPlayerWantedLevel(targetid, 0);
@Release(targetid);
return 1;
}
http://i39.tinypic.com/2ng762b.png
http://i41.tinypic.com/spx2rc.png
Help me please