07.05.2010, 12:41
So....i have one problem the command not work on second IsPlayerIRangeOfPoint
Code
On Top
//------------------------------------------------------------------------------------
OnPlayerCommandText
Code
On Top
pawn Код:
//Car Deliver #1----------------------------------------------------------------
new pcar1;
new delcar1;
#define delcar1cpk 2123.5168,1408.8640,10.5551
//Car Deliver #2-----------------------------------------------------------------------
new pcar2;
new delcar2;
#define delcar2cpk -1847.9258,1303.1699,40.8130
OnPlayerCommandText
pawn Код:
//Car Deliver #1----------------------------------------------------------------
if(!strcmp(cmdtext,"/deliverinfo",true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1096.3978,-828.5516,86.9453))
{
TogglePlayerControllable(playerid,0);
pcar1=AddStaticVehicle(451,1104.6639,-826.5826,86.6451,2.5916,18,18);
SetPlayerCameraPos(playerid, 1099.6971,-819.3141,86.9453);
SetPlayerCameraLookAt(playerid,1104.6639,-826.5826,86.6451);
SendClientMessage(playerid, YELLOW, "Deliver Town: San Fierro");
SendClientMessage(playerid, YELLOW, "Deliver Location: Home");
SendClientMessage(playerid, YELLOW, "Deliver Reward: 7500$");
SendClientMessage(playerid, YELLOW, "Type /acceptdeliver To Start The Deliver");
SendClientMessage(playerid, YELLOW, "Type /denydeliver To Deny The Deliver");
}
/*NOT WORKING
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1096.3978,-828.5516,86.9453))
{
pcar2 = AddStaticVehicle(411, 1098.7465, -1772.5841, 13.0737, 90.2169, 106, 1);
TogglePlayerControllable(playerid,0);
SetPlayerPos(playerid,1081.1340,-1772.1558,13.3520);
SetPlayerCameraPos(playerid, 1089.6786,-1771.3965,13.3490);
SetPlayerCameraLookAt(playerid, 1098.9934,-1775.5352,13.0715);
SendClientMessage(playerid, YELLOW, "Deliver Town: Las Venturas");
SendClientMessage(playerid, YELLOW, "Deliver Location: Royal Casino Parking Lot");
SendClientMessage(playerid, YELLOW, "Deliver Reward: 7500$");
SendClientMessage(playerid, YELLOW, "Type /acceptdeliver To Start The Deliver");
SendClientMessage(playerid, YELLOW, "Type /denydeliver To Deny The Deliver");
}*/
return 1;
}
if(!strcmp(cmdtext,"/acceptdeliver",true))
{
if(IsPlayerInRangeOfPoint(playerid,3.0,1081.1340,-1772.1558,13.3520))
{
DestroyVehicle(pcar1);
delcar1=AddStaticVehicle(411, 1098.9934, -1775.5352, 13.0715, 89.5071, 106, 1);
PutPlayerInVehicle(playerid,delcar1,0);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPlayerCheckpoint(playerid, delcar1cpk, 3.0);
}
/*
NOT WORKING
else if(IsPlayerInRangeOfPoint(playerid,3.0,1096.3978,-828.5516,86.9453))
{
DestroyVehicle(pcar2);
delcar2=AddStaticVehicle(451,1104.6639,-826.5826,86.6451,2.5916,18,18);
PutPlayerInVehicle(playerid,delcar2,0);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,1);
SetPlayerCheckpoint(playerid, delcar2cpk, 3.0);
}*/
return 1;
}
if(!strcmp(cmdtext,"/denydeliver",true))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1081.1340,-1772.1558,13.3520))
{
SetPlayerPos(playerid,1081.1340,-1772.1558,13.3520);
DestroyVehicle(pcar1);
TogglePlayerControllable(playerid,1);
SetCameraBehindPlayer(playerid);
}
/*NOT WORKING
else if(IsPlayerInRangeOfPoint(playerid, 7.0,1096.3978,-828.5516,86.9453))
{
SetPlayerPos(playerid,1096.3978,-828.5516,86.9453);
DestroyVehicle(pcar2);
TogglePlayerControllable(playerid,1);
SetCameraBehindPlayer(playerid);
}*/
return 1;
}
if(!strcmp(cmdtext,"/canceldeliver",true))
{
if(IsPlayerInVehicle(playerid, delcar1))
{
RemovePlayerFromVehicle(playerid);
DisablePlayerCheckpoint(playerid);
SetTimer("destroyvehicle",5000,0);
}
return 1;
}