22.04.2014, 20:14
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
exit command
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:
But i can't apply it in SetPlayerPos function, so how doing for solve..?
/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;
}
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;
so i tryed like this:
pawn Код:
SetPVarFloat(playerid,"entercoords",GetPlayerPos(playerid,x,y,z));