23.02.2011, 09:33
(
Последний раз редактировалось (SF)Noobanatior; 24.02.2011 в 02:48.
)
try this
pawn Код:
#include <a_samp>
new timer1;
new bool:Swiatla[MAX_PLAYERS];
new engine,lights,alarm,doors,bonnet,boot,objective;
forward ToggleSwiatla(playerid);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
if (strcmp("/awaryjne", cmdtext, true, 10) == 0)return timer1 = SetTimerEx("ToggleSwiatla", 1000, 1, "i", playerid);
if (strcmp("/awaryjne-off", cmdtext, true, 10) == 0)return KillTimer(timer1);
return 0;
}
public ToggleSwiatla(playerid){
switch(Swiatla[playerid]){
case true:{
SwiatlaOFF(playerid);
Swiatla[playerid] = false;
}
case false:{
SwiatlaON(playerid);
Swiatla[playerid] = true;
}
}
}
stock SwiatlaON(playerid){
new veh = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
GivePlayerMoney(playerid,4000);
return 1;
}
stock SwiatlaOFF(playerid){
new veh = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
GivePlayerMoney(playerid,5000);
return 1;
}