29.08.2011, 18:02
Hello, i want to add /afix (heals you're vehicle) and /aheal (heals hp 100 and armor 100) how do i have to do that?
if(strcmp(cmd, "/afix", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~r~Your ~g~Vehicle ~y~Fixed!",1000,3);
}
else return SendClientMessage(playerid,COLOR_RED,"ERROR: you are not in any vehicle");
return 1;
}
if(strcmp(cmd, "/aheal", true) == 0)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_YELLOW,"Youhave been healed/armoured");
return 1;
}
|
if (strcmp("/aheal", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid,100); SetPlayerArmour(playerid,100); return 1; } |
|
if (strcmp("/afix", cmdtext, true, 10) == 0) { new vehicleid = GetPlayerVehicleID(playerid); SetVehicleHealth(vehicleid, 1000.0); // 1000 is full vehicle health SendClientMessage(playerid, COLOR_YELLOW, "Your vehicle has been successfully repaired"); // Don't forget to define color yellow at the top return 1; } |
if(PlayerInfo[playerid][Adminlevel]