/exit Faction dont respond.
#1

Hello, I have problem and I really need help in it, I'm not understand way it happends , I will show you the script to.
1.first:
When I doing a /enter faction it works and when I go to pickup and trying to type : /enter it entering me in the int.
When I doing a /exit faction it dont works and when I go to pickup and trying to type : /exit it not doing noting Like it didnt respond.

What should I do ?

Here's the exit's :
pawn Код:
if(strcmp(cmd, "/exit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new i = playerid;
            if(PlayerToPoint(4, playerid,1427.0173,-2450.5798,-11.6056))
            {//Hospital garage
                new vehicleid;
                vehicleid = GetPlayerVehicleID(i);
                GameTextForPlayer(playerid, "~w~Los Santos", 5000, 3);
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerPos(i,1138.9572,-1326.8223,13.7649);
                SetVehiclePos(vehicleid, 1138.9572,-1326.8223,13.7649);
                SetVehicleZAngle(vehicleid, 90.4533);
            }
            if(PlayerToPoint(4, playerid,-229.30,140.125,27.77))
            {//Taxi Exit
                new vehicleid;
                vehicleid = GetPlayerVehicleID(i);
                GameTextForPlayer(playerid, "~w~Los Santos", 5000, 3);
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerPos(i,1643.20,-2142.73,13.69);
            }
            if(PlayerToPoint(4, playerid,2087.2979,2804.6628,-16.1744))
            {//Hospital AS
                GameTextForPlayer(playerid, "~w~Los Santos", 5000, 3);
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerPos(i,1176.9792,-1326.2288,14.0480);
            }
            if(PlayerToPoint(4, playerid,315.8312,-143.2213,999.6016))
            {//Ammunation
                GameTextForPlayer(playerid, "~w~Los Santos", 5000, 3);
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerPos(i,1365.4950,-1279.3027,13.5469);
            }
            if(PlayerToPoint(2.0, i, -2171.0400,645.4891,1057.5938))//Hitman HQ Exit
            {
                 SetPlayerPos(i, 870.2368,-25.2136,63.9689);
                 SetPlayerVirtualWorld(i, 0);
                 SetPlayerInterior(i, 0);
                 return 1;
            }
            if(PlayerToPoint(4, playerid,-2029.66,-119.47,1035.17))
            {//Driving School
                GameTextForPlayer(playerid, "~w~Los Santos", 5000, 3);
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerPos(i,2049.0593,-1908.5194,13.5469);
            }
            if(PlayerToPoint(2, i,238.7272,142.0942,1003.0234))
            {//FBI HQ
                GameTextForPlayer(i, "~w~Los Santos", 5000, 3);
                SetPlayerInterior(i, 0);
                SetPlayerVirtualWorld(i, 0);
                SetPlayerPos(i,1153.8212,-1180.8107,32.8187);
            }
And here's the /Enter's:
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if(PlayerToPoint(2, i,1172.0834,-1325.5232,15.4078))
                {//Hospital
                    GameTextForPlayer(i, "~r~Los Santos Hospital Station", 5000, 6);
                    SetPlayerInterior(i, 1);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,2087.5503,2804.2629,-15.7109);
                }
                if(PlayerToPoint(3, i,1368.6711,-1279.9377,13.5469))
                {//Ammunation
                    GameTextForPlayer(i, "~r~Ammunation", 5000, 1);
                    SendClientMessage(playerid, COLOR_GREEN, " Goto the checkpoint and do /gun");
                    SetPlayerCheckpoint(playerid, 307.9722,-141.4586,999.6016, 2);
                    SetPlayerInterior(i, 7);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,314.820983,-141.431991,999.601562);
                }
                if(PlayerToPoint(2, i,1643.25,-2414,13.69))
                {//Taxi ENETER
                    GameTextForPlayer(i, "~r~Taxi Station", 5000, 1);
                    SetPlayerInterior(i, 18);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,-229.2980,1401.0678,28.2656);
                }
                if(PlayerToPoint(2, i,2081.3047,2829.7400,-16.1744))
                {//Hospital door 2
                    GameTextForPlayer(i, "~r~Garage", 5000, 6);
                    SetPlayerInterior(i, 1);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,1425.9532,-2438.2498,-10.8973);
                }
                if(PlayerToPoint(2, i,1425.8643,-2437.5854,-11.6056))
                {//Hospital door
                    GameTextForPlayer(i, "~r~All Saints", 5000, 6);
                    SetPlayerInterior(i, 1);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,2081.9600,2825.2571,-16.1744);
                }
                if(PlayerToPoint(2, i,2045.9812,-1907.9951,13.5469))
                {//Driving School
                    GameTextForPlayer(i, "~w~License Department", 5000, 3);
                    SetPlayerInterior(i, 3);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,-2029.5632,-117.7680,1035.1719);
                }
                if(PlayerToPoint(2, i,1310.2178,-1367.0743,13.5184))
                {//Paintball
                    GameTextForPlayer(i, "Paintball", 5000, 3);
                    SetPlayerInterior(playerid, 10);
                    GivePlayerWeapon(playerid, 29, 99999);
                    GivePlayerWeapon(playerid, 24, 99999);
                    GivePlayerWeapon(playerid, 31, 99999);
                    GivePlayerWeapon(playerid, 34, 99999);
                    SendClientMessage(playerid, COLOR_GREEN, "Welcome to Paintball");
                    PaintballPlayers ++;
                    PlayerPaintballing[playerid] = 1;
                    new rand = random(sizeof(PaintballSpawns));
                    SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
                }
                if(PlayerToPoint(2, i,1153.8212,-1180.8107,32.8187))
                {//FBI HQ
                    GameTextForPlayer(i, "~b~FBI", 5000, 3);
                    SetPlayerInterior(i, 3);
                    SetPlayerVirtualWorld(i, 1);
                    SetPlayerPos(i,238.7272,142.0942,1003.0234);
                }
                if(PlayerToPoint(2.0, i,870.2368,-25.2136,63.9689))//Hitman HQ Entrance
                {
                     SetPlayerPos(i, -2171.0400,645.4891,1057.5938);
                     SetPlayerVirtualWorld(i, 99);
                     SetPlayerInterior(i, 1);
                     return 1;
                }
                if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
                    {
                        SetPlayerInterior(playerid,HouseInfo[i][hInt]);
                        SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
                        SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
                        GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 3);
                        PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
                        PlayerInfo[playerid][pLocal] = i;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Locked", 5000, 3);
                    }
                }
            }
I dont think I need to show pickup's becuase there already in the script so it's not the problem the problem it is that I cant exit.
I didnt saw in the script problem, It compile good.
If you know how to fix post it here it will be very helpfully.
Using SA:MP : Windows Server.R2
Thanks , Max.
Reply
#2

Way no one is Helping?
Reply
#3

why the hell do you use
Quote:

if(IsPlayerConnected(playerid))

if you only can use commands if you can only use commands if your ingame?
Reply
#4

I can't see any problem on the /exit command.
But I can tell that if it's doing nothing, every expression (the PlayerToPoint's) is false.
Also, the /exit command that you've posted is'nt the full command...
Reply
#5

Both are wrong, you have to compare the positions with

pawn Код:
if(condition)
{
//code
}
else if(condition)
{
//code
}
else if(condition)
{
//code
}
and not

pawn Код:
if(condition)
{
//code
}
if(condition)
{
//code
}
if(condition)
{
//code
}
Reply
#6

Quote:
Originally Posted by CuervO
Посмотреть сообщение
Both are wrong, you have to compare the positions with

pawn Код:
if(condition)
{
//code
}
else if(condition)
{
//code
}
else if(condition)
{
//code
}
and not

pawn Код:
if(condition)
{
//code
}
if(condition)
{
//code
}
if(condition)
{
//code
}
You can also stock them in.
Reply
#7

I also noticed something on /enter.. You're making a loop for every house when using /enter, remove that loop and place it on the house entering part, not at the starting of /enter.
Reply
#8

So please tell me how it can be that the exit is mached has enter : SAME SCRIPT only Virtualworld 0 and enter is 1
and the int's..
how enter is working and exit isnt?
Reply
#9

Quote:
Originally Posted by Amit_B
Посмотреть сообщение
I can't see any problem on the /exit command.
But I can tell that if it's doing nothing, every expression (the PlayerToPoint's) is false.
Also, the /exit command that you've posted is'nt the full command...
Yea so what the full command?
Reply
#10

new i = playerid is a completely FAIL.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)