SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 10/05/2010, 09:11 PM   #1
Hash [NL-RP]
Banned
 
Join Date: May 2010
Posts: 161
Reputation: 0
Default [Need Help] Explosive Help.

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;
  }
Hash [NL-RP] is offline  
Old 10/05/2010, 10:35 PM   #2
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,793
Reputation: 1177
Default Re: [Need Help] Explosive Help.

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.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline  
Old 10/05/2010, 10:59 PM   #3
Backwardsman97
High-roller
 
Backwardsman97's Avatar
 
Join Date: Nov 2007
Posts: 1,501
Reputation: 36
Default Re: [Need Help] Explosive Help.

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;
}
Backwardsman97 is offline  
Old 11/05/2010, 02:25 AM   #4
coole210
Gangsta
 
Join Date: Jul 2008
Location: Canada
Posts: 995
Reputation: 84
Default Re: [Need Help] Explosive Help.

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;
  }
coole210 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Explosive Barrel Ironboy500 Help Archive 14 17/04/2010 03:59 PM
[FilterScript] [FS]Explosive Bullet's [Servidor R7 Necessario] GhOsT[X] Lanšamentos/Releases 8 02/04/2010 02:27 PM
Adding Explosive Barrels? DJDhan Help Archive 5 10/12/2009 08:31 AM
Explosive Barrel (Timer Bomb) virspector Filterscripts 11 19/09/2009 08:00 AM
Explosive barrel bug?? MB@ Client Support 3 26/08/2009 05:39 AM


All times are GMT. The time now is 11:17 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.