SA-MP Forums Archive
help with mine command - 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: help with mine command (/showthread.php?tid=145585)



help with mine command - iggy1 - 02.05.2010

hi i feel bad im only posting for help then again my advise wont help anyone haha
i made what i thought was a simple command its when a player types /mine an explosive barrel spawn at the players location weird thing is if i type /m or /mne ect, it works but if i type /mine i get unknown command, i know i can prob just change the name of the command but still i cant figure out what im doing wrong can someone please help thanks in advance, here is the code
Код:
if(strcmp("/mine", cmdtext, true) && IsPlayerInDynamicArea(playerid, warzonearea) && GetPlayerMoney(playerid)>=5000)
  {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);//x,y,z now hold the co-ords of the player when he typed /mine
    CreateDynamicObject(1225,x,y,z,0.0,0.0,0.0,10,-1);//create explosive at players co-ords
    GivePlayerMoney(playerid, -5000);
    return 1;
  }
again thanks for ur time
edit: indenting fixed was pasted


Re: help with mine command - Antonio [G-RP] - 02.05.2010

Try this..

Код:
if(strcmp("/mine", cmdtext, true) == 0)
{
if(!IsPlayerInDynamicArea(playerid, warzonearea)
{
SendClientMessage(playerid, COLOR_HERE, "You arent in a Dynamic Area!");
return 1;
}
if(GetPlayerMoney(playerid) <=4999)
{
SendClientMessage(playerid, COLOR_HERE, "You dont have enough money!);
return 1;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);//x,y,z now hold the co-ords of the player when he typed /mine
CreateDynamicObject(1225,x,y,z,0.0,0.0,0.0,10,-1);//create explosive at players co-ords
GivePlayerMoney(playerid, -5000);
return 1;
}



Re: help with mine command - iggy1 - 02.05.2010

U sir are a star!!
i will try and find what i did wrong if anyone has time to post what i did wrong please do if not thanks anyway

edit: its ok i c what i did wrong now


Re: help with mine command - Antonio [G-RP] - 02.05.2010

Glad I could help