10.02.2011, 23:13
Well I was trying to figure this out but I couldn't so what I wanted to do is add health to the players current health for ex. player has 50 hp and he uses a command that gives him +20hp how would i do that?
new Float:HP;
GetPlayerHealth(playerid, HP);
SetPlayerHealth(playerid, HP+20);
new Float:HP; GetVehicleHealth(playerid, HP); SetVehicleHealth(playerid, HP+20);
if(!strcmp(cmdtext, "/taisyti", true)) { if(playerDB[playerid][specialybe]!=13){SendClientMessage(playerid,RED,"* this command is only for mechanik!"); return 1;} if(!IsPlayerInAnyVehicle(playerid)){ SendClientMessage(playerid,RED,"* you're not in a car"); return 1; } if(GetPlayerMoneyA(playerid)<50) { SendClientMessage(playerid,RED,"* price for 100hp is 50lt"); return 1; } GivePlayerMoneyA(playerid,-50); SendClientMessage(playerid,GREEN,"* added 100hp to vehicle!"); if(IsPlayerInAnyVehicle(playerid)) GetVehicleHealth(playerid, carHP); SetVehicleHealth(playerid, carHP+100); return 1; }
new Float:carHP;