VehRepair Command Problem -
IvancheBG - 08.07.2011
I made a repair command wich cost 14500 but how to make it when i type /vehrepair the car repairs but i want after 2 minutes to type again with timer.How to do that!!
Re: VehRepair Command Problem -
IvancheBG - 08.07.2011
Can SomeOne Help Me
Re: VehRepair Command Problem -
Basicz - 08.07.2011
pawn Код:
new
gVehDelay[ playerid ] = { -1, ... }
;
COMMAND:vehrepair( playerid, params[ ] )
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "Silly boy, you are not in any vehicle." );
if ( gVehDelay[ playerid ] != -1 )
return SendClientMessage( playerid, -1, "Please wait before using the command again! Or pedobear will ate you." );
if ( GetPlayerMoney( playerid ) < 14500 )
return SendClientMessage( playerid, -1, "Not enough money. Kill a pedobear for money!" );
RepairVehicle( GetPlayerVehicleID( playerid ) );
gVehDelay[ playerid ] = 10;
SetTimerEx( "useRepairAgain", 120000, false, "i", playerid );
return 1;
}
forward useRepairAgain( playerid ); public useRepairAgain( playerid )
{
gVehDelay[ playerid ] = -1;
SendClientMessage( playerid, -1, "Now you can /repairveh your car again!" );
return 1;
}
EDIT: [HiC]TheKiller was late :P
Re: VehRepair Command Problem -
[HiC]TheKiller - 08.07.2011
pawn Код:
forward repair(playerid);
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/vehrepair", true))
{
if(GetPVarInt(playerid, "repair") == 1) return SendClientMessage(playerid, 0x008000FF, "You repaired in the last two minutes!");
//.......
SetPVarInt(playerid, "repair", 1);
SetTimerEx("repair", 120000, false, "i", playerid);
return 1;
}
return 0;
}
public repair(playerid)
{
SetPVarInt(playerid, "repair", 0);
return 1;
}
Re: VehRepair Command Problem -
IvancheBG - 08.07.2011
The Killer Didnt work when i repair it repairs but when I repair second time it repair again I dont want to repair again i want to wate 2 minutes.
Re: VehRepair Command Problem -
IvancheBG - 08.07.2011
Can SomeOne Help Me
Re: VehRepair Command Problem -
Basicz - 08.07.2011
Did you try my code?
It should works fine....
Re: VehRepair Command Problem -
IvancheBG - 08.07.2011
But I dont you zcmd and dcmd Or what is the command!!!
Re: VehRepair Command Problem -
Rolyy - 08.07.2011
Please stop double posting every 10 minutes, scripters have more things to do then just helping 1 member.
Give them some time and post per 5 hours or somthing, atleast not per 10 minutes.
Forum Rule is posting per 24 hours I thought, So watch it.
Re: VehRepair Command Problem -
Basicz - 08.07.2011
OMFG, convert it to strcmp..... LAZY KID!
I bet a pedobear will ate you tomorrow.......
And a nyancat will annoy you when you sleep........
pawn Код:
new
gVehDelay[ playerid ] = { -1, ... }
;
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if ( !strcmp( cmdtext, "/vehrepair", true ) )
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "Silly boy, you are not in any vehicle." );
if ( gVehDelay[ playerid ] != -1 )
return SendClientMessage( playerid, -1, "Please wait before using the command again! Or pedobear will ate you." );
if ( GetPlayerMoney( playerid ) < 14500 )
return SendClientMessage( playerid, -1, "Not enough money. Kill a pedobear for money!" );
RepairVehicle( GetPlayerVehicleID( playerid ) );
gVehDelay[ playerid ] = 10;
SetTimerEx( "useRepairAgain", 120000, false, "i", playerid );
return 1;
}
return 0;
} // Ye I know, indentation sucks :D
forward useRepairAgain( playerid ); public useRepairAgain( playerid )
{
gVehDelay[ playerid ] = -1;
SendClientMessage( playerid, -1, "Now you can /repairveh your car again!" );
return 1;
}