04.08.2016, 17:51
Hi guys,
So im creating a checkpoint for a player and it appears and everything but when i enter it nothing happens. I have even put a SendClientMessage() on the if(PlayerToPoint()) to see if it detects the player nearby but nothing happens. Heres the script:
Please help me. It doesnt even disable the checkpoint
So im creating a checkpoint for a player and it appears and everything but when i enter it nothing happens. I have even put a SendClientMessage() on the if(PlayerToPoint()) to see if it detects the player nearby but nothing happens. Heres the script:
PHP код:
if(PlayerInfo[playerid][pOrigin] == 1)
{
CreateCheckpoint(playerid,CivilianCheckPoint[Xcp1],CivilianCheckPoint[Ycp1],CivilianCheckPoint[Zcp1],3.0); //
}
if(PlayerInfo[playerid][pOrigin] == 2)
{
CreateCheckpoint(playerid,CivilianCheckPoint[Xcp2],CivilianCheckPoint[Ycp2],CivilianCheckPoint[Zcp2],3.0); //
}
if(PlayerInfo[playerid][pOrigin] == 3)
{
CreateCheckpoint(playerid,CivilianCheckPoint[Xcp3],CivilianCheckPoint[Ycp3],CivilianCheckPoint[Zcp3],3.0); //
}
if(PlayerInfo[playerid][pOrigin] == 4)
{
CreateCheckpoint(playerid,CivilianCheckPoint[Xcp4],CivilianCheckPoint[Ycp4],CivilianCheckPoint[Zcp4],3.0); //
}
if(PlayerInfo[playerid][pOrigin] == 5)
{
CreateCheckpoint(playerid,CivilianCheckPoint[Xcp5],CivilianCheckPoint[Ycp5],CivilianCheckPoint[Zcp5],3.0); //
}
if(PlayerInfo[playerid][pOrigin] == 6)
{
CreateCheckpoint(playerid,CivilianCheckPoint[Xcp6],CivilianCheckPoint[Ycp6],CivilianCheckPoint[Zcp6],3.0); //
}
PHP код:
public:OnPlayerEnterCheckpoint(playerid)
{
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp1],CivilianCheckPoint[Ycp1],CivilianCheckPoint[Zcp1]))
{
SendClientMessage(playerid, COLOR_RED, "PARABENS"); // my attempt to see if the script works. It does not.
DisablePlayerCheckpoint(playerid);
for(new h = 0; h < sizeof(Houses); h++)
{
if(PlayerToPoint(8.0, playerid, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 1 && Houses[h][Rentable] == 1)
{
PlayerInfo[playerid][pHouseKey] = h;
GivePlayerEuros(playerid,-Houses[h][RentCost]);
PlayerInfo[playerid][pAluguer] = Houses[h][RentCost];
Houses[h][Money] = Houses[h][Money]+Houses[h][RentCost];
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
PlayerInfo[playerid][pRegistered] = 3;
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Hotel arrendado com sucesso, o preco da renda serб descontado de paycheck em paycheck.");
OnPlayerDataSave(playerid);
return 1;
}
}
}
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp2],CivilianCheckPoint[Ycp2],CivilianCheckPoint[Zcp2]))
{
DisablePlayerCheckpoint(playerid);
for(new h = 0; h < sizeof(Houses); h++)
{
if(PlayerToPoint(8.0, playerid, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 1 && Houses[h][Rentable] == 1)
{
PlayerInfo[playerid][pHouseKey] = h;
GivePlayerEuros(playerid,-Houses[h][RentCost]);
PlayerInfo[playerid][pAluguer] = Houses[h][RentCost];
Houses[h][Money] = Houses[h][Money]+Houses[h][RentCost];
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
PlayerInfo[playerid][pRegistered] = 3;
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Hotel arrendado com sucesso, o preco da renda serб descontado de paycheck em paycheck.");
OnPlayerDataSave(playerid);
return 1;
}
}
}
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp3],CivilianCheckPoint[Ycp3],CivilianCheckPoint[Zcp3]))
{
DisablePlayerCheckpoint(playerid);
for(new h = 0; h < sizeof(Houses); h++)
{
if(PlayerToPoint(8.0, playerid, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 1 && Houses[h][Rentable] == 1)
{
PlayerInfo[playerid][pHouseKey] = h;
GivePlayerEuros(playerid,-Houses[h][RentCost]);
PlayerInfo[playerid][pAluguer] = Houses[h][RentCost];
Houses[h][Money] = Houses[h][Money]+Houses[h][RentCost];
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
PlayerInfo[playerid][pRegistered] = 3;
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Hotel arrendado com sucesso, o preco da renda serб descontado de paycheck em paycheck.");
OnPlayerDataSave(playerid);
return 1;
}
}
}
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp4],CivilianCheckPoint[Ycp4],CivilianCheckPoint[Zcp4]))
{
DisablePlayerCheckpoint(playerid);
for(new h = 0; h < sizeof(Houses); h++)
{
if(PlayerToPoint(8.0, playerid, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 1 && Houses[h][Rentable] == 1)
{
PlayerInfo[playerid][pHouseKey] = h;
GivePlayerEuros(playerid,-Houses[h][RentCost]);
PlayerInfo[playerid][pAluguer] = Houses[h][RentCost];
Houses[h][Money] = Houses[h][Money]+Houses[h][RentCost];
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
PlayerInfo[playerid][pRegistered] = 3;
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Hotel arrendado com sucesso, o preco da renda serб descontado de paycheck em paycheck.");
OnPlayerDataSave(playerid);
return 1;
}
}
}
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp5],CivilianCheckPoint[Ycp5],CivilianCheckPoint[Zcp5]))
{
DisablePlayerCheckpoint(playerid);
for(new h = 0; h < sizeof(Houses); h++)
{
if(PlayerToPoint(8.0, playerid, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 1 && Houses[h][Rentable] == 1)
{
PlayerInfo[playerid][pHouseKey] = h;
GivePlayerEuros(playerid,-Houses[h][RentCost]);
PlayerInfo[playerid][pAluguer] = Houses[h][RentCost];
Houses[h][Money] = Houses[h][Money]+Houses[h][RentCost];
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
PlayerInfo[playerid][pRegistered] = 3;
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Hotel arrendado com sucesso, o preco da renda serб descontado de paycheck em paycheck.");
OnPlayerDataSave(playerid);
return 1;
}
}
}
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp6],CivilianCheckPoint[Ycp6],CivilianCheckPoint[Zcp6]))
{
DisablePlayerCheckpoint(playerid);
if(PlayerInfo[playerid][pAulaMed] == 1)
{
PlayerInfo[playerid][pCursMed] = 1;
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
OnPlayerDataSave(playerid);
Timer6 = SetTimerEx("iniciaraulamedtut", 8, false, "d", playerid);
}
else if(PlayerInfo[playerid][pAulaEng] == 1)
{
PlayerInfo[playerid][pCursEng] = 1;
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
OnPlayerDataSave(playerid);
Timer6 = SetTimerEx("iniciaraulaengtut", 8, false, "d", playerid);
}
else if(PlayerInfo[playerid][pAulaPol] == 1)
{
PlayerInfo[playerid][pCursPol] = 1;
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
OnPlayerDataSave(playerid);
Timer6 = SetTimerEx("iniciaraulapoltut", 8, false, "d", playerid);
}
else if(PlayerInfo[playerid][pAulaAgro] == 1)
{
PlayerInfo[playerid][pCursAgro] = 1;
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
OnPlayerDataSave(playerid);
Timer6 = SetTimerEx("iniciaraulaagrotut", 8, false, "d", playerid);
}
}
if(PlayerToPoint(4.0,playerid, CivilianCheckPoint[Xcp7],CivilianCheckPoint[Ycp7],CivilianCheckPoint[Zcp7]))
{
DisablePlayerCheckpoint(playerid);
for(new h = 0; h < sizeof(Houses); h++)
{
if(PlayerToPoint(8.0, playerid, Houses[h][EnterX], Houses[h][EnterY], Houses[h][EnterZ]) && Houses[h][Owned] == 1 && Houses[h][Rentable] == 1)
{
PlayerInfo[playerid][pHouseKey] = h;
GivePlayerEuros(playerid,-Houses[h][RentCost]);
PlayerInfo[playerid][pAluguer] = Houses[h][RentCost];
Houses[h][Money] = Houses[h][Money]+Houses[h][RentCost];
PlayerInfo[playerid][ptutfeito] = 1;
PlayerInfo[playerid][ptutcompleto] = 1;
PlayerInfo[playerid][pRegistered] = 3;
SetPlayerInterior(playerid,Houses[h][ExitInterior]);
SetPlayerPos(playerid,Houses[h][ExitX],Houses[h][ExitY],Houses[h][ExitZ]);
SetPlayerVirtualWorld(playerid,h);
SendClientMessage(playerid, COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Hotel arrendado com sucesso, o preco da renda serб descontado de paycheck em paycheck.");
OnPlayerDataSave(playerid);
return 1;
}
}
}
}
Please help me. It doesnt even disable the checkpoint