Job Caego-loader Crash
#1

Hello guys I am a Moroccan scripter
I use SCRP as a gm but I have a little problem with this one
There's a job Cargo loader when I type the command /startdelivery everything is fine but when I try to type N to put the goods in the truck that crash , any Help please

Quote:

Dialog:StartDelivery(playerid, response, listitem, inputtext[])
{
if (response)
{
new id = Job_NearestPoint(playerid);

if (id == -1)
return 0;

PlayerData[playerid][pLoadType] = listitem + 1;
PlayerData[playerid][pLoadCrate] = 1;
PlayerData[playerid][pLoading] = 1;

SendServerMessage(playerid, "Ai selectat sa transporti \"%s\". Incarca marfa in vehicul.", inputtext);
SetPlayerCheckpoint(playerid, JobData[id][jobPoint][0], JobData[id][jobPoint][1], JobData[id][jobPoint][2], 1.0);

SetPlayerAttachedObject(playerid, 4, 3014, 1, 0.038192, 0.371544, 0.055191, 0.000000, 90.000000, 357.668670, 1.000000, 1.000000, 1.000000);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);

ApplyAnimation(playerid, "CARRY", "liftup", 4.1, 0, 0, 0, 0, 0, 1);
ShowPlayerFooter(playerid, "Apasa ~y~'N'~w~ pentru a incarca.");
}
return 1;
}

Quote:

CMDtartdelivery(playerid, params[])
{
new id = Job_NearestPoint(playerid);

if (PlayerData[playerid][pJob] != JOB_COURIER)
return SendErrorMessage(playerid, "You don't have the appropriate job.");

if (id == -1 || JobData[id][jobType] != JOB_COURIER)
return SendErrorMessage(playerid, "You are not in range of any loading point.");

if (PlayerData[playerid][pLoadType] > 0)
return SendErrorMessage(playerid, "You have already started a delivery.");

if (IsPlayerInAnyVehicle(playerid))
return SendErrorMessage(playerid, "You must exit the vehicle first.");

Dialog_Show(playerid, StartDelivery, DIALOG_STYLE_LIST, "Select Type", "Retail Supplies\nAmmunition\nClothing\nFood Supplies\nGasoline\nFurniture", "Select", "Cancel");
return 1;
}

Screen :

Reply
#2

Can you show us the KeyStateChange command of this system?
Reply
#3

Quote:
Originally Posted by Rufio
Посмотреть сообщение
Can you show us the KeyStateChange command of this system?
Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PlayerData[playerid][pTutorial] || PlayerData[playerid][pHospital] != -1 || !IsPlayerSpawned(playerid) || PlayerData[playerid][pCuffed] || PlayerData[playerid][pInjured])
return 0;

if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED && newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP))
ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff", 4.0, 0, 1, 1, 0, 0, 1);

if (newkeys & KEY_CROUCH && IsPlayerInAnyVehicle(playerid))
{
cmd_ouvrir(playerid, "\1");
}
if (newkeys & KEY_CROUCH && IsPlayerInRangeOfPoint(playerid, 1.5, -226.4219, 1408.4594, 26.7734) && PlayerData[playerid][pTutorialStage] == 1)
{
DisablePlayerCheckpoint(playerid);

PlayerData[playerid][pTutorialStage] = 2;
SendClientMessage(playerid, COLOR_SERVER, "Appuyez 'N' pour ramasser n'importe quel objet.");
}
if (newkeys & KEY_YES && IsPlayerSpawned(playerid))
{
if (PlayerData[playerid][pJailTime] > 0)
return SendErrorMessage(playerid, "Vous ne pouvez pas ouvrir votre inventaire en prison.");

if (PlayerData[playerid][pCuffed] > 0 || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY)
return SendErrorMessage(playerid, "Vous ne pouvez pas ouvrir votre inventaire.");

OpenInventory(playerid);
}
if (newkeys & KEY_SPRINT && IsPlayerSpawned(playerid) && PlayerData[playerid][pLoopAnim])
{
ClearAnimations(playerid);
HidePlayerFooter(playerid);

PlayerData[playerid][pLoopAnim] = false;
}
if (newkeys & KEY_FIRE && PlayerData[playerid][pDrinking])
{
if (GetPlayerAnimationIndex(playerid) != 15 && GetPlayerAnimationIndex(playerid) != 16 && !PlayerData[playerid][pDrinkTime])
{
if (GetProgressBarValue(PlayerData[playerid][pDrinkBar]) <= 0.0)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);

DestroyProgressBar(PlayerData[playerid][pDrinkBar]);
PlayerData[playerid][pDrinking] = 0;

SendServerMessage(playerid, "Vous avez fini de boire la bouteille.");
}
else
{
PlayerData[playerid][pDrinkTime] = 2;

switch (PlayerData[playerid][pDrinking])
{
case 1: PlayerData[playerid][pThirst] = (PlayerData[playerid][pThirst] + 5 >= 100) ? (100) : (PlayerData[playerid][pThirst] + 5);
case 2: PlayerData[playerid][pThirst] = (PlayerData[playerid][pThirst] + 5 >= 100) ? (100) : (PlayerData[playerid][pThirst] + 5);
}
SetProgressBarValue(PlayerData[playerid][pDrinkBar], GetProgressBarValue(PlayerData[playerid][pDrinkBar]) - 10.0);
UpdateProgressBar(PlayerData[playerid][pDrinkBar], playerid);
}
}
}
if (newkeys & KEY_FIRE && PlayerData[playerid][pMining] && IsPlayerNearMine(playerid))
{
if (PlayerData[playerid][pMineTime] > 0 || PlayerData[playerid][pMinedRock])
return 1;

new id = Job_NearestPoint(playerid);

if (id != -1)
{
PlayerData[playerid][pMineTime] = 1;
SetTimerEx("MineTime", 400, false, "d", playerid);

if (PlayerData[playerid][pMineCount] < 5)
{
PlayerData[playerid][pMineCount]++;

ApplyAnimation(playerid, "BASEBALL", "null", 4.0, 0, 1, 1, 0, 0, 1);
ApplyAnimation(playerid, "BASEBALL", "BAT_4", 4.0, 0, 1, 1, 0, 0, 1);
}
else
{
PlayerData[playerid][pMinedRock] = 1;
PlayerData[playerid][pMineCount] = 0;

RemovePlayerAttachedObject(playerid, 4);

ApplyAnimation(playerid, "BSKTBALL", "null", 4.0, 0, 1, 1, 0, 0, 1);
ApplyAnimation(playerid, "BSKTBALL", "BBALL_pickup", 4.0, 0, 1, 1, 0, 0, 1);

SetPlayerAttachedObject(playerid, 4, 2936, 5, 0.044377, 0.029049, 0.161334, 265.922912, 9.904896, 21.765972, 0.500000, 0.500000, 0.500000);
SendServerMessage(playerid, "Vous avez creusй un rocher. Remettre au marqueur.");

SetPlayerCheckpoint(playerid, JobData[id][jobDeliver][0], JobData[id][jobDeliver][1], JobData[id][jobDeliver][2], 2.5);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
}
}
}
else if (newkeys & KEY_CTRL_BACK)
{
if (PlayerData[playerid][pUsedMagazine])
{
new weaponid = PlayerData[playerid][pHoldWeapon];

switch (weaponid)
{
case 22:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Colt 45");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 17);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 24:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Desert Eagle");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 7);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 25:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Shotgun");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, ;
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 28:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Micro SMG");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 50);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 29:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "MP5");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 30);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 32:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Tec-9");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 50);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 30:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "AK-47");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 30);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 33:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Rifle");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 5);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
case 34:
{
HoldWeapon(playerid, 0);
PlayerPlaySoundEx(playerid, 36401);

Inventory_Remove(playerid, "Sniper");
PlayReloadAnimation(playerid, weaponid);

GiveWeaponToPlayer(playerid, weaponid, 5);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s dйtient sur l'arme et il le coqs.", ReturnName(playerid, 0));
}
}
return 1;
}
}
else if (newkeys & KEY_NO && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
static
string[320];

if (PlayerData[playerid][pTutorialStage] == 2 && IsPlayerInRangeOfPoint(playerid, 1.5, -226.4219, 1408.4594, 26.7734) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
Inventory_Add(playerid, "Demo Soda", 1543);
DestroyPlayerObject(playerid, PlayerData[playerid][pTutorialObject]);

PlayerData[playerid][pTutorialStage] = 3;
SendClientMessage(playerid, COLOR_SERVER, "Appuyez sur 'Y' pour ouvrir votre inventaire et sйlectionnйe le soda.");
return 1;
}
if (PlayerData[playerid][pHoldWeapon] > 0)
{
if (PlayerData[playerid][pUsedMagazine])
Inventory_Add(playerid, "Magazine", 2039);

HoldWeapon(playerid, 0);
return SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s rйpudie son arme vide.", ReturnName(playerid, 0));
}
if (PlayerData[playerid][pLoadCrate])
{
for (new i = 1; i != MAX_VEHICLES; i ++) if (IsPlayerNearBoot(playerid, i))
{
if (!IsLoadableVehicle(i))
return SendErrorMessage(playerid, "Vous ne pouvez pas charger les cartons dans ce vйhicule.");

if (CoreVehicles[i][vehLoadType] != 0 && CoreVehicles[i][vehLoadType] != PlayerData[playerid][pLoadType])
return SendErrorMessage(playerid, "Le vehicule est dйja rйmplie par d'autres choses.");

if (CoreVehicles[i][vehLoads] >= 6)
return SendErrorMessage(playerid, "Le vehicule peut seulement cacher 6 cartons.");

CoreVehicles[i][vehLoads]++;
CoreVehicles[i][vehLoadType] = PlayerData[playerid][pLoadType];

ApplyAnimation(playerid, "porter", "dйposer", 4.0, 0, 0, 0, 0, 0);


if (CoreVehicles[i][vehLoads] == 6)
{
DisablePlayerCheckpoint(playerid);

if (PlayerData[playerid][pShipment] != -1)
{
PlayerData[playerid][pDeliverShipment] = 1;

SendServerMessage(playerid, "Vous avez chargй toutes les caisses. Tapez /decharger au marqueur.");
SetPlayerCheckpoint(playerid, BusinessData[PlayerData[playerid][pShipment]][bizDeliver][0], BusinessData[PlayerData[playerid][pShipment]][bizDeliver][1], BusinessData[PlayerData[playerid][pShipment]][bizDeliver][2], 3.0);
}
else switch (PlayerData[playerid][pLoadType])
{
case 1: SendServerMessage(playerid, "Vous avez dйcharger tout le stock. Tapez /decharger а n'importe quelle 24/7.");
case 2: SendServerMessage(playerid, "Vous avez dйcharger tout le stock. Tapez /decharger а n'importe quelle magasin d'armes.");
case 3: SendServerMessage(playerid, "Vous avez dйcharger tout le stock. Tapez /decharger а n'importe quelle magasin de vиtement.");
case 4: SendServerMessage(playerid, "Vous avez dйcharger tout le stock. Tapez /decharger а n'importe quelle fast food.");
case 5: SendServerMessage(playerid, "Vous avez dйcharger tout le stock. Tapez /decharger а n'importe quelle station d'essence .");
case 6: SendServerMessage(playerid, "Vous avez dйcharger tout le stock. Tapez /decharger а n'importe quelle magasin de meubles.");
}
PlayerData[playerid][pLoading] = 0;
PlayerData[playerid][pLoadType] = 0;
}
PlayerData[playerid][pLoadCrate] = 0;

RemovePlayerAttachedObject(playerid, 4);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);

return 1;
}
}
for (new i = 0; i != MAX_BACKPACKS; i ++) if (BackpackData[i][backpackExists] && !BackpackData[i][backpackPlayer] && IsPlayerInRangeOfPoint(playerid, 2.0, BackpackData[i][backpackPos][0], BackpackData[i][backpackPos][1], BackpackData[i][backpackPos][2])) {
return Backpack_Items(playerid, i);
}
if (PlayerData[playerid][pCarryTrash])
{
for (new i = 1; i != MAX_VEHICLES; i ++) if (GetVehicleModel(i) == 408 && IsPlayerNearBoot(playerid, i))
{
if (CoreVehicles[i][vehTrash] >= 10)
return SendErrorMessage(playerid, "Ce vйhicule ne peut plus tenir la corbeille (Limite: 10).");

CoreVehicles[i][vehTrash]++;

RemovePlayerAttachedObject(playerid, 4);


PlayerData[playerid][pCarryTrash] = 0;
break;
}
}

if (PlayerData[playerid][pCarryCrate] != -1)
{
for (new i = 1; i != MAX_VEHICLES; i ++) if (IsLoadableVehicle(i) && IsPlayerNearBoot(playerid, i))
{
if (GetVehicleCrates(i) >= GetMaxCrates(i))
return SendErrorMessage(playerid, "Ce vйhicule ne peut pas plus tenir des stocks (limit: %d).", GetMaxCrates(i));

CrateData[PlayerData[playerid][pCarryCrate]][crateVehicle] = i;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);

RemovePlayerAttachedObject(playerid, 4);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s met le carton dans la(le) %s.", ReturnName(playerid, 0), ReturnVehicleName(i));

PlayerData[playerid][pCarryCrate] = -1;
ApplyAnimation(playerid, "CARRY", "putdwn", 4.0, 0, 0, 0, 0, 0);
break;
}
}
else if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
new
count = 0,
id = Item_Nearest(playerid);

if (id != -1)
{
string = "";

for (new i = 0; i < MAX_DROPPED_ITEMS; i ++) if (count < MAX_LISTED_ITEMS && DroppedItems[i][droppedModel] && IsPlayerInRangeOfPoint(playerid, 1.5, DroppedItems[i][droppedPos][0], DroppedItems[i][droppedPos][1], DroppedItems[i][droppedPos][2]) && GetPlayerInterior(playerid) == DroppedItems[i][droppedInt] && GetPlayerVirtualWorld(playerid) == DroppedItems[i][droppedWorld]) {
NearestItems[playerid][count++] = i;

strcat(string, DroppedItems[i][droppedItem]);
strcat(string, "\n");
}
if (count == 1)
{
if (DroppedItems[id][droppedWeapon] != 0)
{
if (PlayerData[playerid][pPlayingHours] < 2)
return SendErrorMessage(playerid, "Vous devez avoir au moins deux heures de jeux.");

GiveWeaponToPlayer(playerid, DroppedItems[id][droppedWeapon], DroppedItems[id][droppedAmmo]);

Item_Delete(id);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s ramasse quelque chose de la terre", ReturnName(playerid, 0));
Log_Write("logs/droppick.txt", "[%s] %s a ramassй un %s.", ReturnDate(), ReturnName(playerid, 0), ReturnWeaponName(DroppedItems[id][droppedWeapon]));

}
else if (PickupItem(playerid, id))
{
format(string, sizeof(string), "~g~%s~w~ ajoute dans votre inventaire!", DroppedItems[id][droppedItem]);
ShowPlayerFooter(playerid, string);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s ramasse quelque chose de la terre", ReturnName(playerid, 0));
Log_Write("logs/droppick.txt", "[%s] %s a ramassй un \"%s\".", ReturnDate(), ReturnName(playerid, 0), DroppedItems[id][droppedItem]);
}
else
SendErrorMessage(playerid, "Vous n'avez plus de place dans votre inventaire.");
}
else Dialog_Show(playerid, PickupItems, DIALOG_STYLE_LIST, "Ramasser l'item", string, "Valider", "Annuler");
}
}
}
else if (newkeys & KEY_SECONDARY_ATTACK)
{
static
id = -1;

if ((id = Vendor_Nearest(playerid)) != -1)
{
switch (VendorData[id][vendorType])
{
case 1:
{
if (GetMoney(playerid) < 3)
return SendErrorMessage(playerid, "Vous devez avoir au moin 3 dollars.");

if (PlayerData[playerid][pVendorTime] > 0)
return SendErrorMessage(playerid, "S'il vous plaоt patientez avant d'acheter encore d'un distributeur а nouveau.");

if (Inventory_Count(playerid, "Cooked Burger") >= 5)
return SendErrorMessage(playerid, "Vous avez beaucoup d'humburger dans votre inventaire.");

id = Inventory_Add(playerid, "Cooked Burger", 2703);

if (id != -1)
{
PlayerData[playerid][pVendorTime] = 3;

GiveMoney(playerid, -3);
ApplyAnimation(playerid, "DEALER", "shop_pay", 4.0, 0, 0, 0, 0, 0);

SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s sort de l'argent de sa poche et achиte un burger..", ReturnName(playerid, 0));
ShowPlayerFooter(playerid, "Votre ~p~burger~w~ a ete ajouter dans votre inventaire.");
}
}
case 2:
{
if (GetMoney(playerid) < 2)
return SendErrorMessage(playerid, "Vous devez avoir au moin 2 dollars.");

if (PlayerData[playerid][pVendorTime] > 0)
return SendErrorMessage(playerid, "S'il vous plaоt patientez avant d'acheter encore d'un distributeur а nouveau.");

if (Inventory_Count(playerid, "Soda") >= 10)
return SendErrorMessage(playerid, "Vous avez beaucoup de Bouteille de soda dans votre inventaire.");

id = Inventory_Add(playerid, "Soda", 1543);

if (id != -1)
{
PlayerData[playerid][pVendorTime] = 3;

GiveMoney(playerid, -2);
ApplyAnimation(playerid, "VENDING", "VEND_USE", 4.0, 0, 0, 0, 0, 0);

SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s sort de l'argent de sa poche et achиte une Bouteille de Soda.", ReturnName(playerid, 0));
ShowPlayerFooter(playerid, "Votre ~p~soda~w~ a ete ajouter dans votre inventaire.");
}
}
}
}
if (PlayerData[playerid][pRangeBooth] != -1)
{
Booth_Leave(playerid);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s quitte le stand du tir.", ReturnName(playerid, 0));
}
else for (new i = 0; i < MAX_BOOTHS; i ++) if (!g_BoothUsed[i] && IsPlayerInRangeOfPoint(playerid, 1.5, arrBoothPositions[i][0], arrBoothPositions[i][1], arrBoothPositions[i][2]))
{
g_BoothUsed[i] = true;
PlayerData[playerid][pRangeBooth] = i;

UpdateWeapons(playerid);
ResetPlayerWeapons(playerid);

GivePlayerWeapon(playerid, 24, 15000);

Booth_Refresh(playerid);
PlayerTextDrawSetString(playerid, PlayerData[playerid][pTextdraws][81], "~b~Progression:~w~ 0/10");

PlayerTextDrawShow(playerid, PlayerData[playerid][pTextdraws][81]);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s est entrй au stand de tir.", ReturnName(playerid, 0));
return 1;
}
if (PlayerData[playerid][pTutorialStage] == 5 && IsPlayerInRangeOfPoint(playerid, 1.5, -228.8403, 1401.1831, 27.7656))
{
for (new i = 0; i < 100; i ++) {
SendClientMessage(playerid, -1, "");
}
SetDefaultSpawn(playerid);
Dialog_Show(playerid, TutorialConfirm, DIALOG_STYLE_MSGBOX, "tutoriel", "Voulez-vous voir un tuto du serveur ?", "Oui", "Non");
}
if (IsPlayerInRangeOfPoint(playerid, 2.5, -204.5334, -1735.3131, 675.7687) && PlayerData[playerid][pHospitalInt] != -1)
{
SetPlayerPos(playerid, arrHospitalSpawns[PlayerData[playerid][pHospitalInt]][0], arrHospitalSpawns[PlayerData[playerid][pHospitalInt]][1], arrHospitalSpawns[PlayerData[playerid][pHospitalInt]][2]);
SetPlayerFacingAngle(playerid, arrHospitalSpawns[PlayerData[playerid][pHospitalInt]][3]);

SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pHospitalInt] = -1;
}
else if (IsPlayerInRangeOfPoint(playerid, 2.5, 272.2939, 1388.8876, 11.1342))
{
SetPlayerPosEx(playerid, 1206.8619, -1314.3546, 797.0880);
SetPlayerFacingAngle(playerid, 270.0000);

SetPlayerInterior(playerid, 5);
SetPlayerVirtualWorld(playerid, PRISON_WORLD);

SetCameraBehindPlayer(playerid);
}
else if (IsPlayerInRangeOfPoint(playerid, 2.5, 1206.8619, -1314.3546, 796.7880) && GetPlayerVirtualWorld(playerid) == PRISON_WORLD && !PlayerData[playerid][pJailTime])
{
if (PlayerData[playerid][pFreeze])
{
TogglePlayerControllable(playerid, 1);
KillTimer(PlayerData[playerid][pFreezeTimer]);
}
SetPlayerPos(playerid, 272.2939, 1388.8876, 11.1342);
SetPlayerFacingAngle(playerid, 270.0000);

SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);

SetCameraBehindPlayer(playerid);
}
else if (IsPlayerInRangeOfPoint(playerid, 2.5, 1211.1923, -1354.3439, 796.7456) && GetPlayerVirtualWorld(playerid) == PRISON_WORLD)
{
if (PlayerData[playerid][pFreeze])
{
TogglePlayerControllable(playerid, 1);
KillTimer(PlayerData[playerid][pFreezeTimer]);
}
SetPlayerPos(playerid, 201.8927, 1437.1788, 10.5950);
SetPlayerFacingAngle(playerid, 180.0000);

SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);

SetCameraBehindPlayer(playerid);
}
else if (IsPlayerInRangeOfPoint(playerid, 2.5, 201.8927, 1437.1788, 10.5950))
{
SetPlayerPosEx(playerid, 1211.1923, -1354.3439, 797.0456);
SetPlayerFacingAngle(playerid, 0.0000);

SetPlayerInterior(playerid, 5);
SetPlayerVirtualWorld(playerid, PRISON_WORLD);

SetCameraBehindPlayer(playerid);
}
for (new i = 0; i < sizeof(arrHospitalSpawns); i ++) if (IsPlayerInRangeOfPoint(playerid, 3.0, arrHospitalSpawns[i][0], arrHospitalSpawns[i][1], arrHospitalSpawns[i][2]))
{
SetPlayerPos(playerid, -204.5648, -1736.1201, 675.7687);
SetPlayerFacingAngle(playerid, 180.0000);

SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, i + 5000);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pHospitalInt] = i;

return 1;
}
if ((id = Gate_Nearest(playerid)) != -1)
{
cmd_ouvrir(playerid, "\1");
}
if ((id = House_Nearest(playerid)) != -1)
{
if (HouseData[id][houseLocked] || HouseData[id][houseOwner] == 0)
return SendErrorMessage(playerid, "Vous ne pouvez pas entrer dans une maison verrouillйe.");

SetPlayerPos(playerid, HouseData[id][houseInt][0], HouseData[id][houseInt][1], HouseData[id][houseInt][2]);
SetPlayerFacingAngle(playerid, HouseData[id][houseInt][3]);

SetPlayerInterior(playerid, HouseData[id][houseInterior]);
SetPlayerVirtualWorld(playerid, HouseData[id][houseID] + 5000);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pHouse] = HouseData[id][houseID];
return 1;
}
if ((id = House_Inside(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, HouseData[id][houseInt][0], HouseData[id][houseInt][1], HouseData[id][houseInt][2]))
{
SetPlayerPos(playerid, HouseData[id][housePos][0], HouseData[id][housePos][1], HouseData[id][housePos][2]);
SetPlayerFacingAngle(playerid, HouseData[id][housePos][3] - 180.0);

SetPlayerInterior(playerid, HouseData[id][houseExterior]);
SetPlayerVirtualWorld(playerid, HouseData[id][houseExteriorVW]);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pHouse] = -1;
return 1;
}
if ((id = Business_Nearest(playerid)) != -1)
{
if (BusinessData[id][bizLocked])
return SendErrorMessage(playerid, "Le magasin est fermer par le propriйtaire.");

if (PlayerData[playerid][pTask] && !PlayerData[playerid][pStoreTask])
{
PlayerData[playerid][pStoreTask] = 1;
Dialog_Show(playerid, ShowOnly, DIALOG_STYLE_MSGBOX, "24/7", "Vous etes dans un 24/7 vous pouvez trouvez plein d'items a vendre.\nqui peut кtre ajouter a votre Inventaire.\n\nCommencer par un Systиme GPS, pour se retrouver dans cette ville.\nVous pouvez acheter en utilisant /acheter , et sortir avec la touche 'F' ( a cotй de la porte ).", "Fermer", "");

if (IsTaskCompleted(playerid))
{
PlayerData[playerid][pTask] = 0;
ShowPlayerFooter(playerid, "Vous avez ~g~Terminer~w~ toutes les taches !");
}
}
SetPlayerPos(playerid, BusinessData[id][bizInt][0], BusinessData[id][bizInt][1], BusinessData[id][bizInt][2]);
SetPlayerFacingAngle(playerid, BusinessData[id][bizInt][3]);

SetPlayerInterior(playerid, BusinessData[id][bizInterior]);
SetPlayerVirtualWorld(playerid, BusinessData[id][bizID] + 6000);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pBusiness] = BusinessData[id][bizID];

if (strlen(BusinessData[id][bizMessage]) && strcmp(BusinessData[id][bizMessage], "NULL", true)) {
SendClientMessage(playerid, COLOR_DARKBLUE, BusinessData[id][bizMessage]);
}
return 1;
}
if ((id = Business_Inside(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, BusinessData[id][bizInt][0], BusinessData[id][bizInt][1], BusinessData[id][bizInt][2]))
{
SetPlayerPos(playerid, BusinessData[id][bizPos][0], BusinessData[id][bizPos][1], BusinessData[id][bizPos][2]);
SetPlayerFacingAngle(playerid, BusinessData[id][bizPos][3] - 180.0);

SetPlayerInterior(playerid, BusinessData[id][bizExterior]);
SetPlayerVirtualWorld(playerid, BusinessData[id][bizExteriorVW]);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pBusiness] = -1;
return 1;
}
if ((id = Entrance_Nearest(playerid)) != -1)
{
if (EntranceData[id][entranceLocked])
return SendErrorMessage(playerid, "cette porte est verrouillйe au moment.");

if (PlayerData[playerid][pTask])
{
if (EntranceData[id][entranceType] == 2 && !PlayerData[playerid][pBankTask])
{
PlayerData[playerid][pBankTask] = 1;
Dialog_Show(playerid, ShowOnly, DIALOG_STYLE_MSGBOX, "Banque", "Vous кtes dans la banque de Los Santos.\nOu vous pouvez controller votre compte bancaire.\n\nUtilisez /banque dedans pour ouvrir votre compte bancaire.\n& /atm pour utiliser un ATM.", "Fermer", "");

if (IsTaskCompleted(playerid))
{
PlayerData[playerid][pTask] = 0;
ShowPlayerFooter(playerid, "Vous avez ~g~Terminer~w~ toutes les taches !");
}
}
else if (EntranceData[id][entranceType] == 1 && !PlayerData[playerid][pTestTask])
{
PlayerData[playerid][pTestTask] = 1;
Dialog_Show(playerid, ShowOnly, DIALOG_STYLE_MSGBOX, "Auto Ecole", "L'Auto йcole c'est le lieu ou vous pouvez avoir un permis de vehicule.\nVous devez roulez correctement , ne pas faire vite, faire attention au feu's.\n\npour obtenir votre Permis de conduite.\nLa conduite sans permis peut vous causer des problиmes avec la justice.", "Fermer", "");

if (IsTaskCompleted(playerid))
{
PlayerData[playerid][pTask] = 0;
ShowPlayerFooter(playerid, "Vous avez ~g~Terminer~w~ toutes les taches !");
}
}
}
if (EntranceData[id][entranceCustom])
SetPlayerPosEx(playerid, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2]);

else
SetPlayerPos(playerid, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2]);

SetPlayerFacingAngle(playerid, EntranceData[id][entranceInt][3]);

SetPlayerInterior(playerid, EntranceData[id][entranceInterior]);
SetPlayerVirtualWorld(playerid, EntranceData[id][entranceWorld]);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pEntrance] = EntranceData[id][entranceID];
return 1;
}
if ((id = Entrance_Inside(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2]))
{
if (EntranceData[id][entranceCustom])
SetPlayerPosEx(playerid, EntranceData[id][entrancePos][0], EntranceData[id][entrancePos][1], EntranceData[id][entrancePos][2]);

else
SetPlayerPosEx(playerid, EntranceData[id][entrancePos][0], EntranceData[id][entrancePos][1], EntranceData[id][entrancePos][2]);

SetPlayerFacingAngle(playerid, EntranceData[id][entrancePos][3] - 180.0);

SetPlayerInterior(playerid, EntranceData[id][entranceExterior]);
SetPlayerVirtualWorld(playerid, EntranceData[id][entranceExteriorVW]);

SetCameraBehindPlayer(playerid);
PlayerData[playerid][pEntrance] = Entrance_GetLink(playerid);
return 1;
}
if ((id = Crate_Nearest(playerid)) != -1 && PlayerData[playerid][pCarryCrate] == -1 && !IsCrateInUse(id))
{
// If the crate is within a stack, this function below
// will get the highest crate on the stack.

if ((id = Crate_Highest(id)) == -1)
id = Crate_Nearest(playerid);

ApplyAnimation(playerid, "CARRY", "liftup", 4.1, 0, 0, 0, 0, 0, 1);

PlayerData[playerid][pCarryCrate] = id;
SetPlayerAttachedObject(playerid, 4, 964, 1, -0.157020, 0.413313, 0.000000, 0.000000, 88.000000, 180.000000, 0.500000, 0.500000, 0.500000);

SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s se met a genoux et ramasse le cartons.", ReturnName(playerid, 0));
SendServerMessage(playerid, "Vous avez pris le carton mettez le en arriиre du vehicule avec la touche 'N'.");

DestroyDynamicObject(CrateData[id][crateObject]);
DestroyDynamic3DTextLabel(CrateData[id][crateText3D]);

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
CrateData[id][crateObject] = INVALID_OBJECT_ID;
return 1;
}
if (PlayerData[playerid][pCarryCrate] != -1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY && !PlayerData[playerid][pCrafting])
{
ApplyAnimation(playerid, "CARRY", "null", 4.0, 0, 0, 0, 0, 0);
ApplyAnimation(playerid, "CARRY", "putdwn", 4.0, 0, 0, 0, 0, 0);

Crate_Drop(playerid, 1.5);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s lache le carton.", ReturnName(playerid, 0));

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
return 1;
}
}
return 1;
}

This is the KeyStateChange of this system
Reply
#4

There's a lot of code but the most suspicious is Log_Write function. It is known that invalid file handles crashes the server. In order to make sure and not just guess, load crashdetect plugin. For more detailed logs (which is something we need), do this procedure and re-compile your scripts.

After all that done: start the server, execute the command and press N. Post the server log afterwards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)