Question for house system..
#1

Hay dudes, You probably think that i am the person with the most problems in the world regarding pawn, I scripted a house system, but when I create more homes, and go into the one that does not belong to me but with the door open, if the interior of this is the same to a other when I give the command /exit my player spawns at the exit of another house with the same interior.

/join command

pawn Код:
CMD:join(playerid,params[])
{
    for(new i = 0; i < MAX_CASE; i++)
    {
        new nome[34];
        GetPlayerName(playerid,nome,sizeof(nome));
        if(!IsPlayerInRangeOfPoint(playerid,3.5,cinfo[i][entrataX],cinfo[i][entrataY],cinfo[i][entrataZ])) continue;
        if(cinfo[i][acquisita] == 0) return SendClientMessage(playerid,-1,"[SERVER] This house isn't owned, so you can't join in!");
        if(cinfo[i][acquisita] == 1 && strcmp(cinfo[i][proprietario],nome)==0)
        {
            SetPlayerInterior(playerid,cinfo[i][interior]);
            SetPlayerPos(playerid,cinfo[i][uscitaX],cinfo[i][uscitaY],cinfo[i][uscitaZ]);
            SetPlayerVirtualWorld(playerid,0);
        }
        if(cinfo[i][acquisita] == 1 && strcmp(cinfo[i][proprietario],nome)==1 && cinfo[i][chiusa] == 1)
        {
            SendClientMessage(playerid,-1,"[SERVER] You can't join, this house is closed");
        }
        else
        {
            SetPlayerInterior(playerid,cinfo[i][interior]);
            SetPlayerPos(playerid,cinfo[i][uscitaX],cinfo[i][uscitaY],cinfo[i][uscitaZ]);
            SetPlayerVirtualWorld(playerid,0);
        }
    }
    return 1;
}
exit command

pawn Код:
for(new i = 0; i < MAX_CASE; i++)
    {
        for(new j = 0; j < MAX_PLAYERS; j++)
        {
            if(!IsPlayerInRangeOfPoint(j,3.5,cinfo[i][uscitaX],cinfo[i][uscitaY],cinfo[i][uscitaZ])) continue;
            SetPlayerInterior(j,0);
            SetPlayerPos(j,cinfo[i][entrataX],cinfo[i][entrataY],cinfo[i][entrataZ]);
            SetPlayerVirtualWorld(j,0);
            return 1;
        }
    }
    return 1;
I tryed to use SetPVarFloat for store the enter coords so when player give a command /exit he spawn in side enter coords.

so i tryed like this:

pawn Код:
SetPVarFloat(playerid,"entercoords",GetPlayerPos(playerid,x,y,z));
But i can't apply it in SetPlayerPos function, so how doing for solve..?
Reply


Messages In This Thread
Question for house system.. - by Galletziz - 22.04.2014, 20:14
Re: Question for house system.. - by MattTucker - 22.04.2014, 20:18
Re: Question for house system.. - by Galletziz - 22.04.2014, 21:02
Re: Question for house system.. - by Galletziz - 22.04.2014, 21:36
Re: Question for house system.. - by AiRaLoKa - 22.04.2014, 21:48
Re: Question for house system.. - by Galletziz - 22.04.2014, 21:54
Re: Question for house system.. - by Galletziz - 22.04.2014, 22:12
Re: Question for house system.. - by Galletziz - 22.04.2014, 22:44
Re: Question for house system.. - by Galletziz - 22.04.2014, 23:20
Re: Question for house system.. - by Galletziz - 23.04.2014, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)