Command Problem
#1

Код:
CMD:truckjob(playerid)
{
if(forbes[playerid] == 1)
{
if(IsPlayerInDynamicCP(playerid,TruckCheckpointIMP[0]))
{
if(pitza22[playerid] == 1) return SCM(playerid,-1,"{5F9EA0}[Pizza Job]{F0F8FF} You have already taken the job. Type /leavejob to leave pizza job first to continue with trucking job.");
if(truckza22[playerid] == 1) return SCM(playerid,-1,"{5F9EA0}[Truck Job]{F0F8FF} You have already taken the job. ");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 403) return SCM(playerid,-1,"{5F9EA0}[Truck Job]{F0F8FF} Take the truck along trailer if you want the job.");
if(truckza22[playerid] == 0)
{
if(jobcheck44[playerid] == 0) jobcheck44[playerid] = 1;
truckza22[playerid] = 1;
SetPlayerColor(playerid, JOBCOLOR);
if (IsPlayerInRangeOfPoint(playerid, 7.0, 2748.8835,-2449.5698,13.6484))
{
switch(random(5))
{
case 0:
{

truckjobP[playerid][0] = 1;

}
case 1:
{

truckjobP[playerid][1] = 1;
}
case 2:
{

truckjobP[playerid][2] = 1;
}
case 3:
{

truckjobP[playerid][3] = 1;
}
case 4:
{

truckjobP[playerid][4] = 1;
}}}
else if(IsPlayerInRangeOfPoint(playerid, 7.0, 1427.1710,384.0649,18.9994))
{
switch(random(7))
{
case 0:
{

truckjobP[playerid][5] = 1;
}
case 1:
{

truckjobP[playerid][6] = 1;
}
case 2:
{

truckjobP[playerid][7] = 1;
}
case 3:
{

truckjobP[playerid][10] = 1;
}
case 4:
{

truckjobP[playerid][11] = 1;
}
case 5:
{

truckjobP[playerid][14] = 1;
}
case 6:
{

truckjobP[playerid][15] = 1;
}}}
else if(IsPlayerInRangeOfPoint(playerid, 7.0, 971.8930,2133.1138,10.8203))
{
switch(random(6))
{
case 0:
{

truckjobP[playerid][16] = 1;
}
case 1:
{

truckjobP[playerid][17] = 1;
}
case 2:
{

truckjobP[playerid][12] = 1;
}
case 3:
{
truckjobP[playerid][13] = 1;
}
case 4:
{

truckjobP[playerid][8] = 1;
}
case 5:
{

truckjobP[playerid][9] = 1;
}}}

}
}
}
return 1;
}
The cmd is not executing with IsPlayerInRangeOfPoint function but without it, it works. When I enter the cmd nothing happens. Can you find out whats the problem here.
Reply
#2

try use else if
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)