Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 5
- #include <sscanf2>
- #include <ZCMD>
- new Type[MAX_PLAYERS];
- CMD:arma(playerid, params[])
- {
- if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, -1, "* /Arma [WeaponID].");
- else
- {
- GivePlayerWeapon(playerid, params[0], 5000);
- }
- return 1;
- }
- CMD:v(playerid, params[])
- {
- new string[40];
- new Version[40];
- GetPlayerVersion(playerid, Version, sizeof(Version));
- format(string, sizeof(string), "* Versión: {00FFFF}%s{FFFFFF}.", Version);
- SendClientMessage(playerid, -1, string);
- return 1;
- }
- CMD:t(playerid, params[])
- {
- Type[playerid] = 1;
- SendClientMessage(playerid, -1, "* Telenstransportaciones activadas.");
- return 1;
- }
- CMD:e(playerid, params[])
- {
- Type[playerid] = 2;
- SendClientMessage(playerid, -1, "* Explosiones activadas.");
- return 1;
- }
- CMD:n(playerid, params[])
- {
- Type[playerid] = 0;
- SendClientMessage(playerid, -1, "* Nada activado.");
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- switch(Type[playerid])
- {
- case 0:
- {
- new string[200];
- format(string, sizeof(string), "{FF0000}[Arma: %i] - [Cosa: %s] - [Golpeo: %i] - [X: %f, Y: %f, Z: %f].", weaponid, HitType(hittype), hitid, fX, fY, fZ);
- SendClientMessage(playerid, -1, string);
- }
- case 1:
- {
- new string[200];
- new Float:distance = GetPlayerDistanceFromPoint(playerid, fX, fY, fZ);
- format(string, sizeof(string), "* Telenstransportado a: {FF0000}X: %f, Y: %f, Z: %f.{FFFFFF} Distancia: {FF0000}%0.2f{FFFFFF}.", fX, fY, fZ, distance);
- SendClientMessage(playerid, -1, string);
- SetPlayerPos(playerid, fX, fY, fZ+2);
- }
- case 2:
- {
- CreateExplosion(fX, fY, fZ, 6, 30.0);
- new string[200];
- new Float:distance = GetPlayerDistanceFromPoint(playerid, fX, fY, fZ);
- format(string, sizeof(string), "* Explosión creada en {FF0000}%f, %f, %f{FFFFFF}. Distancia: {FF0000}%0.2f{FFFFFF}.", fX, fY, fZ, distance);
- SendClientMessage(playerid, -1, string);
- }
- }
- return 1;
- }
- stock HitType(type)
- {
- new string[10];
- switch(type)
- {
- case 0: string = "Nada";
- case 1: string = "Jugador";
- case 2: string = "Vehículo";
- case 3: string = "Objeto";
- }
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement