23.04.2012, 23:49
i want i add /repair command on [GameMode]RuNix's Cops And Robbers
can u give me /repair cmd
can u give me /repair cmd
CMD:repair ( playerid, params[ ] )
{
if( IsPlayerInAnyVehicle ( playerid ) )
{
RepairVehicle( GetPlayerVehicleID ( playerid ) );
SendClientMessage ( playerid, -1, "* Your vehicle has been repaired!" );
//GivePlayerMoney ( playerid, -100 ), GameTextForPlayer ( playerid, 1, 1000, "~r~-~g~$100" );
// You can uncomment this line ^ if you wish to make it cost $100 (or change the value)
}
else
{
return SendClientMessage ( playerid, -1, "ERROR: You're not inside of a vehicle!" );
}
return true;
}
if (strcmp("/repair", cmdtext, true, 7) == 0)
{
if( IsPlayerInAnyVehicle ( playerid ) )
{
RepairVehicle( GetPlayerVehicleID ( playerid ) );
SendClientMessage ( playerid, -1, "* Your vehicle has been repaired!" );
// GivePlayerMoney ( playerid, -100 ), GameTextForPlayer ( playerid, 1, 1000, "~r~-~g~$100" );
// You can uncomment this line ^ if you wish to make it cost $100 (or change the value)
}
else
{
return SendClientMessage ( playerid, -1, "ERROR: You're not inside of a vehicle!" );
}
return true;
}
dcmd_refuel(playerid,params[]){ #pragma unused params if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid)){ if(IsAtFuelStation(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER){ new vehicleid = GetPlayerVehicleID(playerid); if(Speed[playerid][Refueling] == 0){ if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessage(playerid,COLOR_YELLOW,".:: [ERROR]: This vehicle does not need fuel :."); if(Vehicle[vehicleid][Fuel] >= 100){ SendClientMessage(playerid,COLOR_YELLOW,".:: [FUEL]: Your gas tank is already full."); } else { Vehicle[GetPlayerVehicleID(playerid)][OldFuel] = 0; Speed[playerid][Refueling] = 1; Speed[playerid][ReFuelTimer] = SetTimerEx("ReFill", 1000, true, "i", playerid); } } else { SendClientMessage(playerid,COLOR_YELLOW,".:: [FUEL]: You are allready refueling your car."); } } else { SendClientMessage(playerid,COLOR_YELLOW,".:: [FUEL]: You must be at a gas station to refuel"); } } return true; }
dcmd_repair(playerid,params[]){
{
if( IsPlayerInAnyVehicle ( playerid ) )
{
RepairVehicle( GetPlayerVehicleID ( playerid ) );
SendClientMessage ( playerid, -1, "* Your vehicle has been repaired!" );
// GivePlayerMoney ( playerid, -100 ), GameTextForPlayer ( playerid, 1, 1000, "~r~-~g~$100" );
// You can uncomment this line ^ if you wish to make it cost $100 (or change the value)
}
else
{
return SendClientMessage ( playerid, -1, "ERROR: You're not inside of a vehicle!" );
}
return true;
}
dcmd_repair(playerid, params[])
{
#pragma unused params
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0xFFFF00AA,"Server: Your Vehicle Has Been Repaired!");
}
return 1;
}