if (strcmp("/open police", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid)!=280) return SendClientMessage(playerid, COLOR_ERROR,"You are not a cop");
IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747);
{
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747);)
{
SendClientMessage(playerid, COLOR_RED, "You are not near the gate.");
}
MoveDynamicObject(copgate, 1151.3508, -1222.7382, 9.6951, 3);
SendClientMessage(playerid, COLOR_BLUE, "Gate: Opened.");
return 1;
}
if (strcmp("/open police", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid)!=280) return SendClientMessage(playerid, COLOR_ERROR,"You are not a cop");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
{
MoveDynamicObject(copgate, 1151.3508, -1222.7382, 9.6951, 3);
SendClientMessage(playerid, COLOR_BLUE, "Gate: Opened.");
return 1;
}
else if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
{
SendClientMessage(playerid, COLOR_RED, "You are not near the gate.");
return 1;
}
if (strcmp("/open police", cmdtext, true, 10) == 0)
{
if (GetPlayerSkin(playerid) != 280)
return SendClientMessage(playerid, COLOR_ERROR, !"You are not a cop");
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433, -1226.3589, 17.2747))
return SendClientMessage(playerid, COLOR_RED, !"You are not near the gate.");
MoveDynamicObject(swatgate, 1151.3508, -1222.7382, 9.6951, 3);
return SendClientMessage(playerid, COLOR_BLUE, !"Gate: Opened.");
}
|
Код:
if (strcmp("/open police", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid)!=280) return SendClientMessage(playerid, COLOR_ERROR,"You are not a cop");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
{
MoveDynamicObject(copgate, 1151.3508, -1222.7382, 9.6951, 3);
SendClientMessage(playerid, COLOR_BLUE, "Gate: Opened.");
return 1;
}
else if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
{
SendClientMessage(playerid, COLOR_RED, "You are not near the gate.");
return 1;
}
|
if(strcmp("/open police", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid)!=280) return SendClientMessage(playerid, COLOR_ERROR,"You are not a cop");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747));
{
MoveDynamicObject(copgate, 1151.3508, -1222.7382, 9.6951, 3);
SendClientMessage(playerid, COLOR_BLUE, "Gate: Opened.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not near the gate.");
}
return 1;
}
|
Код:
if (strcmp("/open police", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid)!=280) return SendClientMessage(playerid, COLOR_ERROR,"You are not a cop");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
{
MoveDynamicObject(copgate, 1151.3508, -1222.7382, 9.6951, 3);
SendClientMessage(playerid, COLOR_BLUE, "Gate: Opened.");
return 1;
}
else if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
{
SendClientMessage(playerid, COLOR_RED, "You are not near the gate.");
return 1;
}
|
|
Try this:
PHP код:
and this: https://sampwiki.blast.hk/wiki/Control_Structures#else_if |