18.11.2014, 13:52
I made this game mode where you pick up a pickup and your health is restored to 100. How can i make this a filterscript, because I need the callback OnPlayerPickUpPickup. Help me plz!!!
Thanks guys!
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
new pharmacy;
public OnGameModeInit(){
AddPlayerClass(0,1215.6434,-1323.6664,13.5668,89.0061,0,0,0,0,0,0); //
pharmacy = CreatePickup(1240,1,1172.2653,-1324.0309,15.4045,-1);
}
public OnPlayerPickUpPickup(playerid,pickupid){
if(pickupid == pharmacy){
return Injection(playerid);
}
return 1;
}
Injection(playerid){
new notice[85];
new Float:health;
GetPlayerHealth(playerid,health);
format(notice,sizeof(notice),"Your current health level is approximately %.2f.It has been restored to 100",health);
SendClientMessage(playerid,0xd86b93FF,notice);
SetPlayerHealth(playerid,100);
return 1;
}
main(){}


