Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* CarBomb by Godoy32 FOR SA-MP FORUM */
- #include <a_samp>
- #include <ZCMD>
- #define Precio 50000
- new Bomba[MAX_PLAYERS];
- new BombaA[MAX_VEHICLES];
- public OnFilterScriptInit()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- Bomba[i]=0;
- }
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- BombaA[i]=-1;
- }
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- Bomba[playerid]=0;
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(BombaA[i]==playerid)
- {
- BombaA[i]=-1;
- }
- }
- }
- public OnPlayerConnect(playerid)
- {
- Bomba[playerid]=0;
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(BombaA[i]==playerid)
- {
- BombaA[i]=-1;
- }
- }
- }
- COMMAND:bomba(playerid,params[])
- {
- if(Bomba[playerid]==0)
- {
- if(Precio <= GetPlayerMoney(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid,30,-1676.87,406.17,6.72))
- {
- SendClientMessage(playerid,0x00FF00FF,"Has comprado una bomba, usa /bomba para ponerla en un auto");
- GivePlayerMoney(playerid,-Precio);
- Bomba[playerid]=1;
- return 1;
- }
- else return SendClientMessage(playerid,0xFF0000FF,"No estas cerca de la bomba de SF");
- }
- else return SendClientMessage(playerid,0xFF0000FF,"No tienes dinero ($"#Precio")");
- }
- if(Bomba[playerid]==1)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new a = GetPlayerVehicleID(playerid);
- SendClientMessage(playerid,0x00FF00FF,"Bomba puesta satifactoriamente, usa /bomba para detonarla");
- BombaA[a]=playerid;
- Bomba[playerid]=2;
- return 1;
- }
- else return SendClientMessage(playerid,0xFF0000FF,"No estas en un auto");
- }
- if(Bomba[playerid]==2)
- {
- new q=0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInAnyVehicle(i))
- {
- for(new o = 0; o < MAX_VEHICLES; o++)
- {
- if(BombaA[o]==playerid)
- {
- if(IsPlayerInVehicle(i,o))
- {
- q++;
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(o,X,Y,Z);
- CreateExplosion(X,Y,Z,12,15.0);
- CreateExplosion(X,Y,Z,10,15.0);
- CallRemoteFunction("OnPlayerDeath","ddd",i,playerid,40);
- }
- }
- }
- }
- }
- new st[128 char];
- format(st,128,"Murieron %d jugadores por tu bomba",q);
- SendClientMessage(playerid,0x00FF00FF,st);
- Bomba[playerid]=0;
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(BombaA[i]==playerid)
- {
- new Float:X, Float:Y, Float:Z;
- GetVehiclePos(i,X,Y,Z);
- CreateExplosion(X,Y,Z,12,15.0);
- CreateExplosion(X,Y,Z,10,15.0);
- SendClientMessage(playerid,0x00FF00FF,"Bomba explotada");
- BombaA[i]=-1;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement