help with mine command
#1

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
Reply
#2

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;
}
Reply
#3

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
Reply
#4

Glad I could help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)