Hello! Today after school I've made new chainsaw completing script. I mean that you can now make chainsaw from materials you will find.
Okay so, first to all I'd like to explain here the "recipe". YEAH
Chainsaw:
1. Cutting equipment;
2. Scooter engine;
3. Frame
4. Fueltank;
5. Gears package.
Use "!demountengine" to demount the engine when you are driving Faggio. When u will find all these "ingredients" u can make a chainsaw using "!makechainsaw".
BUT this is not the end because your chainsaw won't work without fuel like you when you hungry. So then u go to the nearest gas station and fill it for $10 (I made $10 cuz I think it's not too much as for VCMP player =P)
Okay, here is code:
put in the beginning:
[pawn]
new cuttingequipment[MAX_PLAYERS];
new gear[MAX_PLAYERS];
new framewithhandles[MAX_PLAYERS];
new fueltank[MAX_PLAYERS];
new engine[MAX_PLAYERS];
new madechainsaw[MAX_PLAYERS];
new filledtank[MAX_PLAYERS];
[/pawn]
put in
public OnGameModeInit():
[pawn]
AddStaticVehicle(192, 112.35513, -1150.53576, 31.30939, 0, 0, 0);//must be the first vehicle, I mean the first in the list
AddStaticVehicle(192, 114.86677, -1150.51501, 31.30939, 0, 0, 0);//must be the second vehicle =P
AddStaticPickup(1, 346, -1243.28869, 83.49330, 11.87996);
AddStaticPickup(2, 346, -974.83831, -693.88696, 11.52398);
AddStaticPickup(3, 346, -1064.71887, 344.63726, 11.26404);
AddStaticPickup(4, 346, -1190.05808, -304.88229, 11.38048);
AddStaticPickup(5, 578, 43.34131, -1055.93249, 10.46328);
[/pawn]
put in
public OnPlayerText(playerid, text[]):
[pawn]
{
if(strcmp(text, "!demountengine", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid==1 || vehicleid==2)
{
if(engine[playerid]==0)
{
SendClientMessage(playerid, 0x00C80CAA, "The engine has been demoted!");
KillVehicleEngine(vehicleid);
engine[playerid]+=1;
}
else if(engine[playerid]==1)
{
SendClientMessage(playerid, 0xFF0000AA, "You already have an engine!");
}
return 0;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are not driving faggio!");
}
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are onfoot!");
}
return 1;
}
else if(strcmp(text, "!makechainsaw", true)==0)
{
if(engine[playerid]>=1 && cuttingequipment[playerid]>=1 && gear[playerid]>=1 && framewithhandles[playerid]>=1 && fueltank[playerid]>=1)
{
SendClientMessage(playerid, 0x00C80CAA, "You have made chainsaw from materials. Go to the gas station to fill it.");
madechainsaw[playerid]=1;
engine[playerid]-=1;
cuttingequipment[playerid]-=1;
gear[playerid]-=1;
framewithhandles[playerid]-=1;
fueltank[playerid]-=1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You don't have enough materials!");
}
return 1;
}
return 1;
}
[/pawn]
put in
public OnPickedUp(pickupid, playerid):
[pawn]
{
if(pickupid==1)
{
cuttingequipment[playerid]+=1;
GameTextForPlayer(playerid, "~o~Cutting equipment ~h~has been found!");
}
else if(pickupid==2)
{
gear[playerid]+=1;
GameTextForPlayer(playerid, "~o~Gears package ~h~has been stolen!");
}
else if(pickupid==3)
{
framewithhandles[playerid]+=1;
GameTextForPlayer(playerid, "~o~Frame ~h~has been found!");
}
else if(pickupid==4)
{
fueltank[playerid]+=1;
GameTextForPlayer(playerid, "~o~Fuel tank ~h~has been found!");
}
else if(pickupid==5)
{
if(madechainsaw[playerid]==1)
{
new pmoney = GetPlayerMoney(playerid);
if(pmoney>=10)
{
GameTextForPlayer(playerid, "~h~Your chainsaw fuel tank has been filled for ~t~$10");
SetPlayerWeapon(playerid, 11, 1);
filledtank[playerid]=1;
madechainsaw[playerid]-=1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You need atleast ~t~$10 to fill your chainsaw fuel tank!");
}
return 1;
}
else
{
GameTextForPlayer(playerid, "~h~You need to equip ~o~chainsaw first!");
}
return 1;
}
return 1;
}
[/pawn]
I hope you will understand the making process, and I also hope u will be
CAREFUL, not like this Guy:
HERE are screenshots with materials locations:
Comments pls!