Help with one of my codes!
#2

You should use [ pawn ] tags when posting code - like this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/missle", cmdtext, true, 7) == 0)
 {
   if(strlen(cmdtext[8]) == 0) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /missle <PlayerID>");
   if(IsPlayerConnected(strval(cmdtext[8])) == 0) return SendClientMessage(playerid, 0xFF0000AA, "Player Not Found");

   new Float:pX, Float:pY, Float:pZ, Float:vX, Float:vY, Float:vZ;
   GetPlayerPos(playerid, pX, pY, pZ);
   GetPlayerPos(strval(cmdtext[8]), vX, vY, vZ);

   if(pX - vX < 10 && pX - vX > -10 && pY - vY < 10 && pY - vY > -10 && pZ - vZ < 10 && pZ - vZ > -10)
   {
    CreateExplosion(?);
    SendClientMessage(strval(cmdtext[8]), 0x00FF00AA, "You have been exploded.");
    SendClientMessage(playerid, 0x00FF00AA, "Player Destroyed");
   }
   else
   {
    SendClientMessage(playerid, 0xFF0000AA, "You are too far apart.");
   }
   return 1;
 }
return 0;
 }
Now, to fix the code.

CreateExplosion(Float:X, Float:Y, Float:Z, type, Float:radius)

As you can see, CreateExplosion needs 5 paramaters, not just X, Y, Z and size.

I'll do the explosion type for you:

pawn Код:
CreateExplosion(vX, vY, vZ, 7, 50)
That will create an explosion of type 7 (Huge) with a radius of 50.

https://sampwiki.blast.hk/wiki/CreateExplosion
https://sampwiki.blast.hk/wiki/Explosion_List
Reply


Messages In This Thread
Help with one of my codes! - by Yoyoyo - 01.03.2009, 23:26
Re: Help with one of my codes! - by 1337pr0 - 02.03.2009, 00:08
Re: Help with one of my codes! - by Yoyoyo - 02.03.2009, 02:17

Forum Jump:


Users browsing this thread: 1 Guest(s)