24.07.2011, 04:22
My friend (Admantis) made this job script for our script, I do know some scripting myself but I don't know why the checkpoints won't work sometimes ( like when you fail or when you pass )
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new newcar = GetPlayerVehicleID(playerid);
if (GetPVarInt(playerid, "QuarryStatus") == 1)
{
switch(random(100))
{
case 0..49:
{
SendClientMessage(playerid, COLOR_WHITE, "[INFO]: You haven't found any diamonds, try digging in another point!");
switch(random(5))
{
case 0: SetPlayerCheckpoint(playerid, 681.9300,822.4588,-27.2878, 10);
case 1: SetPlayerCheckpoint(playerid, 694.9890,842.5770,-27.4996, 10);
case 2: SetPlayerCheckpoint(playerid, 718.9802,923.3948,-19.0700, 10);
case 3: SetPlayerCheckpoint(playerid, 691.6136,738.6771,-5.8858 , 10);
case 4: SetPlayerCheckpoint(playerid, 504.4493,795.1776,-22.2935, 10);
}
}
case 50..99:
{
new diamondcount = 2 + random(15);
SetPVarInt(playerid, "TempDiamonds", diamondcount);
SetPVarInt(playerid, "QuarryStatus", 2);
SetPlayerCheckpoint(playerid, 586.0655,870.0052,-42.4973, 3);
new szstring[128];
format(szstring, 128, "[INFO]: You digged and found %d diamonds. Return to the base and deliver them.", diamondcount);
SendClientMessage(playerid, COLOR_WHITE, szstring);
}
}
}
if (GetPVarInt(playerid, "QuarryStatus") == 2)
{
SetPVarInt(playerid, "QuarryStatus", 0);
SetPVarInt(playerid, "TempDiamonds", 0);
DisablePlayerCheckpoint(playerid);
new togive, szs[128], vtr;
togive = (GetPVarInt(playerid, "TempDiamonds") * 100);
format(szs, 128, "[INFO]: You have sold %d diamonds for {00FF00}$%d, good job!", GetPVarInt(playerid, "TempDiamonds"), togive);
GivePlayerPCash(playerid, togive);
vtr = GetNearestVehicle(playerid, 25);
SetVehicleToRespawn(vtr);
}