Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sistema Chaleco en cuerpo" by Eduardo_1 ($moke).
- Funciones:
- • Al morir, salir se le quita el objeto.
- • Si el jugador no tiene chaleco para tiene la función "TieneChaleco" activada se le quitará el objeto.
- • Si el jugadot tiene chaleco pero no tiene la función activada, esta se le activará y agregará el objeto.
- NO BORRES CRÉDITOS, RESPETA EL TRABAJO DE LOS DEMÁS.
- */
- #include <a_samp>
- #include <zcmd>
- new bool:TieneChaleco[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- TieneChaleco[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(TieneChaleco[playerid] == true)
- {
- TieneChaleco[playerid] = false;
- RemovePlayerAttachedObject(playerid, 0);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(TieneChaleco[playerid] == true)
- {
- TieneChaleco[playerid] = false;
- RemovePlayerAttachedObject(playerid, 0);
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- static Float:Chaleco;
- GetPlayerArmour(playerid, Chaleco);
- if(Chaleco != 0 && TieneChaleco[playerid] == false)
- {
- TieneChaleco[playerid] = true;
- SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.098, 0.039);
- }
- else if(Chaleco == 0 && TieneChaleco[playerid] == true)
- {
- TieneChaleco[playerid] = false;
- RemovePlayerAttachedObject(playerid, 0);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement