10.01.2014, 07:24
Hey guys, I ran into a problem, I downloaded a filterscript, and now I want it to be compatible with my gamemode.
The filterscript I downloaded is somekind of tuning saving one, now what Im trying to do is make sure that players can only unmod their own vehicles.
This is my car /engine command.
Now what I did is I tried to take the
and change it in here.
But I dont know how?
The filterscript I downloaded is somekind of tuning saving one, now what Im trying to do is make sure that players can only unmod their own vehicles.
This is my car /engine command.
pawn Код:
public StartVehicleEngine(playerid, vehicleid)
{
if(IsPlayerConnected(playerid) && IsVehicleSpawned(vehicleid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new autoid = GetPlayerVehicleID(playerid);
if(vehicleid == autoid)
{
new Float:autoelud;
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
GetVehicleHealth(vehicleid, autoelud);
if(autoelud < 500.0)
{
Mootor[vehicleid] = 0;
new string[128];
format(string, sizeof(string), "* Sхiduki mootor ei kдivitunud (( %s ))", RPN(playerid));
SendEmotion(playerid, string);
SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
K2ivitabMootorit[playerid] = 0;
return 1;
}
else if(Aku[vehicleid] < 15)
{
Mootor[vehicleid] = 0;
new string[128];
format(string, sizeof(string), "* Sхiduki mootor ei kдivitunud (( %s ))", RPN(playerid));
SendEmotion(playerid, string);
SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
K2ivitabMootorit[playerid] = 0;
return 1;
}
else
{
new randomStart = random(6);
switch(randomStart)
{
case 0,1,2,3,4:
{
Mootor[vehicleid] = 1;
new string[128];
format(string, sizeof(string), "* Sхiduki mootor kдivitus (( %s ))", RPN(playerid));
SendEmotion(playerid, string);
SetVehicleParamsEx(vehicleid, true, lights, alarm, doors, bonnet, boot, objective);
K2ivitabMootorit[playerid] = 0;
}
case 5:
{
Mootor[vehicleid] = 0;
new string[128];
format(string, sizeof(string), "* Sхiduki mootor ei kдivitunud (( %s ))", RPN(playerid));
SendEmotion(playerid, string);
SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
K2ivitabMootorit[playerid] = 0;
}
}
}
}
}
else
{
K2ivitabMootorit[playerid] = 0;
}
}
return 1;
}
pawn Код:
new autoid = GetPlayerVehicleID(playerid);
if(vehicleid == autoid)
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/eemaldatuuning",cmd,true)==0)
{
if (!IsPlayerInAnyVehicle(playerid)) //HERE SOMEHOW...
{
SendClientMessage(playerid,0xFFFFFF96,"You must be in a vehicle to unmod it.");
return 1;
}
new autoid = GetPlayerVehicleID(playerid);
if(vehicleid == autoid)
if(VehiclesMod[vehicleid][0] > 0)
{
VehiclesMod[vehicleid][0] = 0;
VehiclesMod[vehicleid][1] = 0;
VehiclesMod[vehicleid][2] = 0;
VehiclesMod[vehicleid][3] = 0;
VehiclesMod[vehicleid][4] = 0;
VehiclesMod[vehicleid][5] = 0;
VehiclesMod[vehicleid][6] = 0;
VehiclesMod[vehicleid][7] = 0;
VehiclesMod[vehicleid][8] = 0;
VehiclesMod[vehicleid][9] = 0;
VehiclesMod[vehicleid][10] = 0;
SendClientMessage(playerid,0xFFFFFF96,"Vehicle unmoded and Respawned.");
SetVehicleToRespawn(vehicleid);
return 1;
}
else
{
SendClientMessage(playerid,0xFFFFFF96,"This vehicle isnt moded.");
}
return 1;
}
return 0;
}
