// Repairs the player's vehicle COMMAND:repair(playerid, params[]) { // Send the command to all admins so they can see it SendAdminText(playerid, "/repair", params); // Check if the player has logged in if (APlayerData[playerid][LoggedIn] == true) { // Check if the player's admin-level is at least 1 if (APlayerData[playerid][PlayerLevel] >= 1) { // Check if the player is inside a vehicle if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You are not in a vehicle!"); // Let the player know he's not inside a vehicle and let the server know that this was a valid command // Fully repair the vehicle (damage value and bodywork) RepairVehicle(GetPlayerVehicleID(playerid)); // Send the player a message to inform him that his vehicle has been repaired SendClientMessage(playerid, 0x00FF00FF, "Your vehicle has been successfully repaired!"); } else return 0; } else return 0; // Let the server know that this was a valid command return 1; }
COMMAND:repair(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not logged in as RCON ADMIN!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
return 1;
}
I am big noob bcz it wont work.
Plss edit my post so i can just copy it. TNX !!! |
You check the script I wrote above, it will work. If you want explanation then say it down I will repeat for you.
-FalconX |
No no, I mean. I cant come here and ask you everytime i want to know how to do this, So could you teach me?
|
COMMAND:repair(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not logged in as RCON ADMIN!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
return 1;
}
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not logged in as RCON ADMIN!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");