22.10.2010, 15:54
When you enter the last checkpoint, you arent getting the reward($ 5000 and 1 exp) the job just works but only the reward aint coming. The script:
Please help!
pawn Код:
new sweepercp[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmd, "/startjob", true) == 0)
{
if(PlayerJob[playerid] == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574) // Sweeper
{
PlayerJob[playerid] = 4;
format(string, sizeof(string), "%s Is now a City Cleaner.", PlayerName[playerid]);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_GREEN, "Your job is now a City Cleaner, go clean up the city!");
SendClientMessage(playerid, COLOR_GREY, "HINT: Follow the red markers, after the last marker, you will earn a reward.");
SetPlayerCheckpoint(playerid, 2111.4629, 1231.3583, 10.5532, 3.0);
sweepercp[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a driver of this vehicle.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You must be in a taxi, towtruck, trash or a sweeper to use this command.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"You are already in a job, type /stopjob to stop it.");
}
return 1;
}
if (strcmp(cmd, "/stopjob", true) == 0)
{
if(PlayerJob[playerid] == 4)
{
PlayerJob[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "Your job as a city cleaner is now ended.");
format(string, sizeof(string), "%s Is not a city cleaner anymore.", PlayerName[playerid]);
SendClientMessageToAll(COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You can't stop your job because you don't have one.");
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574) // Towtruck
{
if(GetPlayerState(playerid) == 2)
{
if(PlayerJob[playerid] == 4)
{
new string[128];
PlayerJob[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "Your job as a citycleaner is now ended.");
format(string, sizeof(string), "%s Is not a citycleaner anymore.", PlayerName[playerid]);
SendClientMessageToAll(COLOR_YELLOW, string);
return 1;
}
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new vehicleid;
if(sweepercp[playerid] == 1)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 2;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2075.8213,1221.3730,10.3825,3.0);
break;
}else{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 2)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 3;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2071.4956,1193.2053,10.3826,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 3)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 4;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2143.7239,1192.2974,10.3781,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 4)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 5;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2189.0557,1198.8141,10.6056,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 5)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 6;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2187.6460,1243.2451,10.3780,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 6)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 7;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2188.5874,1326.8960,10.3780,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 7)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 8;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2188.4824,1367.0487,10.5055,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 8)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 9;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2216.0642,1371.5637,10.3788,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 9)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 10;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2240.8525,1370.1974,10.4374,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 10)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 11;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2249.7893,1440.7341,10.3781,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 11)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 12;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2249.7979,1525.4924,10.4153,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 12)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 13;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2199.4731,1535.7467,10.3780,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 13)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 14;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2083.6106,1535.2794,10.3859,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 14)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 15;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2057.7061,1530.6843,10.3831,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 15)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 16;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2045.2826,1521.7644,10.3778,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 16)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 17;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2045.5272,1447.0292,10.3782,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 17)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 18;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2045.3309,1374.0104,10.3781,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 18)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 19;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2045.0875,1282.1979,10.3783,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 19)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 20;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2057.4536,1272.4183,10.3847,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 20)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 21;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2078.6956,1253.1064,10.4908,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 21)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 22;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2108.0239,1234.6117,10.5264,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 22)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 23;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2153.4316,1535.2472,10.3970,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 23)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 24;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2088.0557,1535.6611,10.3978,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 24)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 25;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2054.6680,1535.0712,10.3971,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 25)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 26;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2048.8242,1496.2557,10.3971,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 27)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 28;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2045.8374,1431.4153,10.3971,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 28)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 29;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2045.2809,1373.9707,10.3971,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 29)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 30;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2045.7120,1299.1779,10.3971,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 30)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 31;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2045.8129,1280.2736,10.3970,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 31)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 32;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2055.8057,1276.0430,10.3970,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 32)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 33;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2062.1760,1269.6907,10.3971,3.0);
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 33)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
sweepercp[playerid] = 34;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2107.1804,1233.5475,10.5455,3.0);
GivePlayerMoney(playerid, 5000);
PlayerInfo[i][pExp] ++;
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
if(sweepercp[playerid] == 34)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
GivePlayerMoney(playerid, 5000);
PlayerInfo[i][pExp] ++;
SendClientMessage(playerid, COLOR_GREEN, "Well done buddy, you have cleaned some streets!");
SendClientMessage(playerid, COLOR_GREEN, "You have received $ 5000 and 1 exp.");
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}