[Need Help] Explosive Help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Need Help] Explosive Help. (
/showthread.php?tid=147217)
[Need Help] Explosive Help. -
Hash [NL-RP] - 10.05.2010
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;
}
Re: [Need Help] Explosive Help. -
Lorenc_ - 10.05.2010
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.
Re: [Need Help] Explosive Help. -
Backwardsman97 - 10.05.2010
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;
}
Re: [Need Help] Explosive Help. -
coole210 - 11.05.2010
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;
}