Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //PEDs include debug script
- //-------------------------------------------------
- #include <a_samp> //SA-MP team
- #include <peds> //Gammix
- //-------------------------------------------------
- //formated functions
- #if defined easy_STRING
- #undef easy_STRING
- #endif
- stock easy_STRING[566];
- #define SendClientMessagef(%0,%1,%2,%3) \
- (format(easy_STRING, 145, %2, %3), SendClientMessage(%0,%1,easy_STRING))
- #define SendClientMessageToAllf(%0,%1,%2) \
- (format(easy_STRING, sizeof(easy_STRING), %1, %2), SendClientMessageToAll(%0, easy_STRING))
- #define GameTextForPlayerf(%0,%1,%2,%3,%4) \
- (format(easy_STRING, sizeof(easy_STRING), %1, %4), GameTextForPlayer(%0, easy_STRING, %2, %3))
- //-------------------------------------------------
- main()
- {
- PED_Connect(15, 1841.9462, -1050.7052, 25.1974, 2.9319);//connecting a random ped!
- return 1;
- }
- //-------------------------------------------------
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid, 1841.9462 + 1, -1050.7052, 25.1974);
- GivePlayerWeapon(playerid, 33, 100000);//just for weapon shooting test
- GivePlayerWeapon(playerid, 22, 100000);
- GivePlayerWeapon(playerid, 28, 100000);
- GivePlayerWeapon(playerid, 16, 100000);
- GivePlayerWeapon(playerid, 35, 100000);
- GivePlayerWeapon(playerid, 9, 100000);
- return 1;
- }
- //-------------------------------------------------
- //PEDs include callbacks
- public PED_OnConnect(pedid)
- {
- SendClientMessageToAllf(-1, "DEBUG: PED id %i connected", pedid);
- return 1;
- }
- public PED_OnDisconnect(pedid)
- {
- SendClientMessageToAllf(-1, "DEBUG: PED id %i disconnected", pedid);
- return 1;
- }
- public PED_OnStreamIn(pedid, forplayerid)
- {
- SendClientMessagef(forplayerid, -1, "DEBUG: PED id %i streamed in for you", pedid);
- return 1;
- }
- public PED_OnStreamOut(pedid, forplayerid)
- {
- SendClientMessagef(forplayerid, -1, "DEBUG: PED id %i streamed out for you", pedid);
- return 1;
- }
- public PED_OnSpawn(pedid)
- {
- SendClientMessageToAllf(-1, "DEBUG: PED id %i has spawned", pedid);
- return 1;
- }
- public PED_OnTakeDamage(pedid, issuerid, weaponid, Float:amount, bodypart)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(issuerid, name, MAX_PLAYER_NAME);
- new weapon[28];
- GetWeaponName(weaponid, weapon, sizeof(weapon));
- new bodypartname[28];
- switch(bodypart)
- {
- case 3: bodypartname = "Torso";
- case 4: bodypartname = "Groin";
- case 5: bodypartname = "Left arm";
- case 6: bodypartname = "Right arm";
- case 7: bodypartname = "Left leg";
- case 8: bodypartname = "Right leg";
- case 9: bodypartname = "Headshot!";
- }
- SendClientMessageToAllf(-1, "DEBUG: PED id %i took damage of %0.2f from weapon %s shot by %s on bodypart %s", pedid, amount, weapon, name, bodypartname);
- return 1;
- }
- public PED_OnDeath(pedid, killerid, weaponid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(killerid, name, MAX_PLAYER_NAME);
- new weapon[28];
- GetWeaponName(weaponid, weapon, sizeof(weapon));
- SendClientMessageToAllf(-1, "DEBUG: PED id %i died from weapon %s shot by %s", pedid, weapon, name);
- return 1;
- }
- public OnPlayerTargetPED(playerid, pedid, weaponid)
- {
- new weapon[28];
- GetWeaponName(weaponid, weapon, sizeof(weapon));
- SendClientMessagef(playerid, -1, "DEBUG: You have targeted PED id %i with %s", pedid, weapon);
- return 1;
- }
- public PED_OnUpdate(pedid)
- {
- //SendClientMessageToAllf(-1, "DEBUG: PED id %i has updated!", pedid);
- //this will cause you SPAM in chat !
- return 1;
- }
- //-------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment