Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- MasterJoker's Helmet System v1.0
- Created by MasterJoker
- Copyright (2012), February
- */
- #include <a_samp>
- new IsPlayerWearingHelmet[MAX_PLAYERS];
- #define COLOR_RED 0xFF0000FF
- #define COLOR_GREEN 0x008000FF
- /* -------------------------------------------------------------------------- */
- #if defined FILTERSCRIPT
- #else
- public OnFilterScriptInit()
- {
- print("--------------------------------------");
- print(" MasterJoker's Helmet System Loaded! ");
- print("--------------------------------------");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("--------------------------------------");
- print(" MasterJoker's Helmet System Unloaded!");
- print("--------------------------------------");
- return 1;
- }
- #endif
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new vid = GetVehicleModel(vehicleid);
- new string[128],pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(vid == 448 || vid == 461 || vid == 462 || vid == 463 || vid == 468 || vid == 471 ||
- vid == 481 || vid == 509 || vid == 510 || vid == 521 || vid == 522 || vid == 523 ||
- vid == 571 || vid == 581 || vid == 586)
- {
- if(IsPlayerWearingHelmet[playerid] == 0)
- {
- IsPlayerWearingHelmet[playerid] = 1;
- format(string, sizeof(string), "%s has wear his helmet (Safety Recommended!)", pname);
- SendClientMessageToAll(COLOR_RED, string);
- SendClientMessage(playerid, COLOR_GREEN, "Helmet sucessfully suit!");
- SetPlayerAttachedObject(playerid, 1, 18645, 2, 0.07, 0, 0, 88, 75, 0);
- }
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- new string[128],pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(IsPlayerWearingHelmet[playerid] == 1)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
- IsPlayerWearingHelmet[playerid] = 0;
- format(string, sizeof(string), "%s has remove his helmet", pname);
- SendClientMessageToAll(COLOR_RED, string);
- SendClientMessage(playerid, COLOR_GREEN, "Helmet sucessfully remove!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment