[Need Help] Explosive Help.
#1

Okay, i have recently made half a command to make a explosive barrel,
it is to be used on the Godfather type of script,
it is desgined to remove 100 materials from the player to create the object
but it does\'nt seem to work, it compiles fine, but them object nor the command works
Please help me.

Code:
 if(strcmp(cmdtext, "/PlaceExplosive") == 0)
  {
    if(PlayerInfo[playerid][pMats] > 100)
    PlayerInfo[playerid][pMember] = CreateObject(1225, X, Y, Z, 0.0, 0.0, A+180); 
    else { SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!");
    return 1;
  }
Reply
#2

Code:
 if(strcmp(cmdtext, "/PlaceExplosive") == 0)
  {
    new Float: x, Float: y, Float: z;
    GetPlayerPos(playerid,x,y,z);
    if(PlayerInfo[playerid][pMats] > 100)
    PlayerInfo[playerid][pMember] = CreateObject(1225, x, y, z, 0.0, 0.0, A+180); 
    else { SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that Weapon!");
    return 1;
  }
I think its like that.
Reply
#3

It shouldn\'t have compiled fine unless you defined the x y z somewhere else. You should try indenting more though. And what about this guy?

else { SendClientMessage(playerid,COLOR_GREY," Not enough Materials for that Weapon!");
^

Why did you open a bracket but not close it?

pawn Code:
if(strcmp(cmdtext, "/PlaceExplosive") == 0)
{
   new Float: x, Float: y, Float: z;
   GetPlayerPos(playerid,x,y,z);

   if(PlayerInfo[playerid][pMats] > 100)
     PlayerInfo[playerid][pMember] = CreateObject(1225, x, y, z, 0.0, 0.0, A+180);
   else
     SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!");
   
   return 1;
}
Reply
#4

If that doesn\'t work ill give it a shot:

Code:
	if(strcmp(cmdtext, "/PlaceExplosive") == 0)
  {
    if(PlayerInfo[playerid][pMats] > 100)
		{
		  new Float:X,Float:Y,Float:Z;
		  GetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
    	PlayerInfo[playerid][pMember] = CreateObject(1225,Float:X,Float:Y,Float:Z, 0.0, 0.0, A+180);
    else
    {
    	SendClientMessage(playerid,COLOR_GREY,"  Not enough Materials for that Weapon!");
		}
		return 1;
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)