SA-MP Forums Archive
Spawn +REP - 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)
+--- Thread: Spawn +REP (/showthread.php?tid=479080)



Spawn +REP - iBots - 02.12.2013

i have made a command which is spawn change it is:if i do /spawnchange 1 and i relog i'll spawn at the newbie spawn,if i do /spawnchange 2 i'll spawn inside my house,but there is no errors,and if i have house level 1 it spawns me there and it works,but if i have house level 2 or more it spawns me in the house level 1,why?
pawn Код:
if(strcmp(x_nr,"2",true) == 0)
            {
                if(PlayerInfo[playerid][pHouseAccepted] == 0)
                {
                PlayerInfo[playerid][pSpawn] = 1;
                SendClientMessage(playerid, COLOR_GREY, "You dont have a house.");
                }
                if(PlayerInfo[playerid][pHouseAccepted] == 1)
                {
                PlayerInfo[playerid][pSpawn] = 2;
                SendClientMessage(playerid, COLOR_GREY, "You will now spawn at your house.");
                }
            }



Re: Spawn +REP - iBots - 02.12.2013

this is the /spawnchange 2
and i have set it under SetPlayerSpawn to:
pawn Код:
if(PlayerInfo[playerid][pSpawn] == 2)
                {
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        SetPlayerVirtualWorld(playerid, i+1);
                        SetPlayerInterior(playerid, i+1);
                        SetPlayerFacingAngle(playerid, 0);
                        PutPlayerInHouse(playerid, PlayerInfo[i][pHouseLevel]);
                        PlayerInfo[playerid][pLocal] = i;
                        PlayerInfo[playerid][pVirtualWorld] = i+1;
                    }
                }



Re: Spawn +REP - Tagathron - 02.12.2013

You're not saving the info about your spawn position/VW and so anywhere.
So when you relog it just uses the default one which is set in the script.


Re: Spawn +REP - iBots - 03.12.2013

and how to save it?


Re: Spawn +REP - iBots - 03.12.2013

bump
How to save the position of the spawn and of the houselevel and the vw,in player file it writes:HouseLevel :...
and the levels are here
pawn Код:
switch(level)
        {
            case 1: { PlayerInfo[playerid][pInt] = 1; SetPlayerInterior(playerid,1); SetPlayerPos(playerid,244.5000,305.0000,999.1484); SetPlayerFacingAngle(playerid, 270.0000); } //Small Room 1
            case 2: { PlayerInfo[playerid][pInt] = 2; SetPlayerInterior(playerid,2); SetPlayerPos(playerid,267.1000,305.0000,999.1484); SetPlayerFacingAngle(playerid, 270.0000); } //Small Room 2
            case 3: { PlayerInfo[playerid][pInt] = 10; SetPlayerInterior(playerid,10); SetPlayerPos(playerid,2259.3948,-1135.8015,1050.6403); SetPlayerFacingAngle(playerid, 269.6499); } //Motel Room
            case 4: { PlayerInfo[playerid][pInt] = 15; SetPlayerInterior(playerid,15); SetPlayerPos(playerid,386.8663,1471.6508,1080.1949); SetPlayerFacingAngle(playerid, 86.6616); } //Small House 1
            case 5: { PlayerInfo[playerid][pInt] = 5; SetPlayerInterior(playerid,5); SetPlayerPos(playerid,22.7071,1403.3888,1084.4370); SetPlayerFacingAngle(playerid, 359.5774); } //Small House 2
            case 6: { PlayerInfo[playerid][pInt] = 4; SetPlayerInterior(playerid,4); SetPlayerPos(playerid,301.3000,306.3000,1003.5391); SetPlayerFacingAngle(playerid, 270.0000); } //Wood House
            case 7: { PlayerInfo[playerid][pInt] = 15; SetPlayerInterior(playerid,15); SetPlayerPos(playerid,295.0853,1472.4978,1080.2578); SetPlayerFacingAngle(playerid, 357.6974); } //Med House 1
            case 8: { PlayerInfo[playerid][pInt] = 15; SetPlayerInterior(playerid,15); SetPlayerPos(playerid,386.8132,1471.5809,1080.1949); SetPlayerFacingAngle(playerid, 87.9148); } //Med House 2
            case 9: { PlayerInfo[playerid][pInt] = 2; SetPlayerInterior(playerid,2); SetPlayerPos(playerid,446.9661,1397.6705,1084.3047); SetPlayerFacingAngle(playerid, 3.1456); } //Med House 3
            case 10: { PlayerInfo[playerid][pInt] = 15; SetPlayerInterior(playerid,15); SetPlayerPos(playerid,376.3000,1417.2000,1081.3281); SetPlayerFacingAngle(playerid, 84.5970); } //Rich House 1
            case 11: { PlayerInfo[playerid][pInt] = 15; SetPlayerInterior(playerid,15); SetPlayerPos(playerid,295.0820,1472.5895,1080.2578); SetPlayerFacingAngle(playerid, 357.9638); } //Rich House 2
            case 12: { PlayerInfo[playerid][pInt] = 6; SetPlayerInterior(playerid,6); SetPlayerPos(playerid,234.1893,1064.2260,1084.2115); SetPlayerFacingAngle(playerid, 357.8933); } //Rich House 3
            case 13: { PlayerInfo[playerid][pInt] = 7; SetPlayerInterior(playerid,7); SetPlayerPos(playerid,225.7264,1021.7980,1084.0167); SetPlayerFacingAngle(playerid, 0.4233); } //Rich House 4
            case 14: { PlayerInfo[playerid][pInt] = 12; SetPlayerInterior(playerid,12); SetPlayerPos(playerid,2324.4729,-1148.9298,1050.7101); SetPlayerFacingAngle(playerid, 359.4833); } //Rich House 5
            case 15: { PlayerInfo[playerid][pInt] = 3; SetPlayerInterior(playerid,3); SetPlayerPos(playerid,235.2827,1187.0928,1080.2578); SetPlayerFacingAngle(playerid, 358.8566); } //Rich House 6
            case 16: { PlayerInfo[playerid][pInt] = 6; SetPlayerInterior(playerid,6); SetPlayerPos(playerid,344.4200,304.9100,999.1484); SetPlayerFacingAngle(playerid, 280.0000); } //BDSM Lair
            case 17: { PlayerInfo[playerid][pInt] = 5; SetPlayerInterior(playerid,5); SetPlayerPos(playerid,1226.5758,-812.2072,1084.0078); SetPlayerFacingAngle(playerid, 0.0000); } //Office
            case 18: { PlayerInfo[playerid][pInt] = 6; SetPlayerInterior(playerid,6); SetPlayerPos(playerid,744.4441,1437.6198,1102.7031); SetPlayerFacingAngle(playerid, 360.0000); } //Stripclub
            case 19: { PlayerInfo[playerid][pInt] = 3; SetPlayerInterior(playerid,3); SetPlayerPos(playerid,963.4101,-53.1195,1001.1246); SetPlayerFacingAngle(playerid, 87.6137); } //Brothel
            case 20: { PlayerInfo[playerid][pInt] = 2; SetPlayerInterior(playerid,2); SetPlayerPos(playerid,2549.1807,-1294.7899,1060.9844); SetPlayerFacingAngle(playerid, 262.7453); } //Big Smokes
            default: { PlayerInfo[playerid][pInt] = 1; SetPlayerInterior(playerid,1); SetPlayerPos(playerid,244.5000,305.0000,999.1484); SetPlayerFacingAngle(playerid, 270.0000); } //Small Room 1
        }



Re: Spawn +REP - [D]ry[D]esert - 03.12.2013

Check Y_INI or MySql plugin or any saving system.


Re: Spawn +REP - iBots - 03.12.2013

i have Y_INI plugin,but how to let it get saved by Y_INI?