01.06.2011, 17:35
Hello.
What wrong with this command? with the first gate it works but with the second woun't. And the names must be different.![Smiley](images/smilies/smile.png)
What wrong with this command? with the first gate it works but with the second woun't. And the names must be different.
![Smiley](images/smilies/smile.png)
pawn Code:
if(strcmp(cmd, "/vдrav", true) == 0 || strcmp(cmd, "/vl", true) == 0)
{
if(!strcmp(pName,"Steven_Hayen",true))
{
if(IsPlayerInRangeOfPoint(playerid, 14,323.3900,-1190.5800,76.0000))
{
if(varavsteven == 0)
{
MoveObject(gate, 321.25000000,-1188.27000000,69.66000000,2.00000000);
MoveObject(gate1, 319.14000000,-1190.06000000,68.31000000,2.00000000);
MoveObject(gate2, 319.14000000,-1190.06000000,70.48000000,2.000000000);
MoveObject(gate3, 321.44000000,-1188.21000000,68.31000000,2.000000000);
MoveObject(gate4, 321.45000000,-1188.22000000,70.48000000,2.000000000);
SendClientMessage(playerid, COLOR_BLUE,"Gate opened!");
GetPlayerName(playerid, sendername, sizeof(sendername));
varavsteven = 1;
}
else
{
MoveObject(gate, 321.25000000,-1188.27000000,76.35000000,2.00000000);//CreateObject(971,321.35000000,-1188.27000000,76.35000000,0.00000000,0.00000000,38.33000000);
MoveObject(gate1, 319.14000000,-1190.06000000,75.00000000,2.00000000);
MoveObject(gate2, 319.14000000,-1190.06000000,77.17000000,2.00000000);
MoveObject(gate3, 321.44000000,-1188.21000000,75.00000000,2.00000000);
MoveObject(gate4, 321.45000000,-1188.22000000,77.17000000,2.00000000);
SendClientMessage(playerid, COLOR_BLUE,"Gate closed!");
GetPlayerName(playerid, sendername, sizeof(sendername));
varavsteven = 0;
}
}
}
else if(!strcmp(pName,"Steven_Haayen",true))
{
if(IsPlayerInRangeOfPoint(playerid, 14,1003.13000000,-643.85000000,123.78000000)) //1003.13000000,-643.85000000,123.78000000
{
if(sanderigate == 0)
{
MoveObject(sanderivarav, 1003.13000000,-643.85000000,116.41000000,2.00000000);
SendClientMessage(playerid, COLOR_BLUE,"Gate opened!");
GetPlayerName(playerid, sendername, sizeof(sendername));
sanderigate = 1;
}
else
{
MoveObject(gate, 1003.13000000,-643.85000000,123.78000000,2.00000000);
SendClientMessage(playerid, COLOR_BLUE,"Gate closed!");
GetPlayerName(playerid, sendername, sizeof(sendername));
sanderigate = 0;
}
}
}
return 1;
}