#1

PHP код:
new PDGate1;
new 
PDGate2
PHP код:
public OnGameModeInit()
{  
PDGate1 =CreateObject(9712334.9709472443.3273938.0787200.00000.0000239.6789);
  
PDGate2 =CreateObject(9712294.0793462499.2565925.4683500.00000.0000269.7591);} 
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{

if(
strcmp(cmdtext"/gatedown"true) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid2294.0793462499.2565925.468350))
{
SendClientMessage(playerid0xAA3333AA"Your gate is open");
MoveObject(PDGate22334.9628912443.2885740.2648742.5);
}
else
{
SendClientMessage(playerid0xAA3333AA"Your remote control does not get the signal");
}
return 
1;
}
//
if(strcmp(cmdtext"/gateup"true) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid20.02294.0793462499.2565925.468350))
{
SendClientMessage(playerid0xAA3333AA"Your gate is closed");
MoveObject(PDGate22294.0793462499.2565925.4683503.0);
}
else
{
SendClientMessage(playerid0xAA3333AA"Your remote control does not get the signal");
return 
1;
}
}

if(
strcmp(cmdtext"/gatedown"true) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid20.02334.9709472443.3273938.078720))
{
SendClientMessage(playerid0xAA3333AA"Your gate is open");
MoveObject(PDGate12334.9628912443.2885740.2648742.5);
}
else
{
SendClientMessage(playerid0xAA3333AA"Your remote control does not get the signal");
}
return 
1;
}
//
if(strcmp(cmdtext"/gateup"true) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid20.02334.9709472443.3273938.078720))
{
SendClientMessage(playerid0xAA3333AA"Your gate is closed");
MoveObject(PDGate12334.9709472443.3273938.0787203.0);
}
else
{
SendClientMessage(playerid0xAA3333AA"Your remote control does not get the signal");
}
return 
1;
}

What is the problem here? The gates aren't working...
Reply
#2

It's kinda hard to read this
Next time, please use [ pawn ] [ /pawn ]

Example :
[ pawn ]
// code here
[ /pawn ]

WITHOUT THE SPACES OF COURSE
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/gatedown", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2294.079346, 2499.256592, 5.468350))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is open");
MoveObject(PDGate2, 2334.962891, 2443.288574, 0.264874, 2.5);
}
else if(IsPlayerInRangeOfPoint(playerid, 20.0, 2334.970947, 2443.327393, 8.078720))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is open");
MoveObject(PDGate1, 2334.962891, 2443.288574, 0.264874, 2.5);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Your remote control does not get the signal");
}
return 1;
}

if(strcmp(cmdtext, "/gateup", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2294.079346, 2499.256592, 5.468350))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is closed");
MoveObject(PDGate2, 2294.079346, 2499.256592, 5.468350, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 20.0, 2334.970947, 2443.327393, 8.078720))
{
SendClientMessage(playerid, 0xAA3333AA, "Your gate is closed");
MoveObject(PDGate1, 2334.970947, 2443.327393, 8.078720, 3.0);
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Your remote control does not get the signal");
return 1;
}
Reply
#4

@Memoryz

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2294.079346, 2499.256592, 5.468350))
replace with:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 20.0, 2294.079346, 2499.256592, 5.468350))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)