3 Noob questions. (Might pay)
#1

Please help, I might pay a buck XD.


Help 1
When you type /sellart .. It will ONLY sell the art if you have 1 .. If you have 2 art it will say "You don't have enough."
Код:
 if(!strcmp(cmdtext,"/Sellart",true))
{
if(ART[playerid] == 1)
{
  SendClientMessage(playerid,COLOR_GREEN,"________________Art Sold!_____________________________");
  SendClientMessage(playerid,COLOR_GREEN,"You sell your peace of art, To the art muesem.");
  ART[playerid] = 0;
  GivePlayerMoney(playerid,50);
  SendClientMessage(playerid,COLOR_GREEN,"+50 USD.");
  SendClientMessage(playerid,COLOR_GREEN,"________________________________________________________");
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"You don't have art to sell!");
}
return 1;
}
Help 2
You can type /drawart .. And even though you have 0 pencils and paper you will STILL create art .. Your pencils and paper will just go -1 ... I want to do it so if you don't have at least 1
Код:
 PAPER[MAX_PLAYERS];
Код:
PENCIL[MAX_PLAYERS];
Then you can't type /drawart.
Код:
if(!strcmp(cmdtext,"/Drawart",true))
{
  SendClientMessage(playerid,COLOR_GREEN,"________________You start to draw._____________________");
  SendClientMessage(playerid,COLOR_GREEN,"You grab one pencil and a sheet of paper out your backpack.");
  SendClientMessage(playerid,COLOR_GREEN,"You slowly start to draw, Working on your peace of art.");
  SendClientMessage(playerid,COLOR_GREEN,"Estimated time left 1 minute.");
  SetTimerEx("MAKINGART",60000,0,"i",playerid);
	SendClientMessage(playerid,COLOR_GREEN,"________________________________________________________");
  return 1;
}
Help 3
When you type /drawart you can type it as many times as you want! ..
I want to make it so that if you are drawing art and you try to type /drawart again it will say "Wait until you finish your first art first!".

Код:
if(!strcmp(cmdtext,"/Drawart",true))
{
  SendClientMessage(playerid,COLOR_GREEN,"________________You start to draw._____________________");
  SendClientMessage(playerid,COLOR_GREEN,"You grab one pencil and a sheet of paper out your backpack.");
  SendClientMessage(playerid,COLOR_GREEN,"You slowly start to draw, Working on your peace of art.");
  SendClientMessage(playerid,COLOR_GREEN,"Estimated time left 1 minute.");
  SetTimerEx("MAKINGART",60000,0,"i",playerid);
	SendClientMessage(playerid,COLOR_GREEN,"________________________________________________________");
  return 1;
}
Reply
#2

I don't see a problem with the first code. You shore it doesn't work ?

Second code:
pawn Код:
if(!strcmp(cmdtext,"/Drawart",true))
{
  if(PAPER[playerid] <= 0) return SendClientMessage(playerid,COLOR_GREEN,"You need some paper");
  if(PENCIL[playerid] <= 0) return SendClientMessage(playerid,COLOR_GREEN,"You need a pencil");

  SendClientMessage(playerid,COLOR_GREEN,"________________You start to draw._____________________");
  SendClientMessage(playerid,COLOR_GREEN,"You grab one pencil and a sheet of paper out your backpack.");
  SendClientMessage(playerid,COLOR_GREEN,"You slowly start to draw, Working on your peace of art.");
  SendClientMessage(playerid,COLOR_GREEN,"Estimated time left 1 minute.");
  SendClientMessage(playerid,COLOR_GREEN,"________________________________________________________");
  return 1;
}
Third code
pawn Код:
//top of script
new CreatingArt[MAX_PLAYERS];

//onplayercommandtext
if(!strcmp(cmdtext,"/Drawart",true))
{
  if(CreatingArt[playerid] == 1) return SendClientMessage(playerid,COLOR_GREEN,"You are already making art. Wait 1 minute to finish");
  SendClientMessage(playerid,COLOR_GREEN,"________________You start to draw._____________________");
  SendClientMessage(playerid,COLOR_GREEN,"You grab one pencil and a sheet of paper out your backpack.");
  SendClientMessage(playerid,COLOR_GREEN,"You slowly start to draw, Working on your peace of art.");
  SendClientMessage(playerid,COLOR_GREEN,"Estimated time left 1 minute.");
  SetTimerEx("MAKINGART",60000,0,"i",playerid);
  CreatingArt[playerid] = 1;
  SendClientMessage(playerid,COLOR_GREEN,"________________________________________________________");
  return 1;
}

forward MAKINGART(playerid);
public MAKINGART(playerid)
{
  CreatingArt[playerid] = 0;
  SendClientMessage(playerid,COLOR_GREEN,"You finished making art. You can now draw more art");
}
Reply
#3

To the first -
pawn Код:
if(!strcmp(cmdtext,"/sellart",true))
  {
    if(ART[playerid] > 0)
    {
      SendClientMessage(playerid,COLOR_GREEN,"________________Art Sold!_____________________________");
      SendClientMessage(playerid,COLOR_GREEN,"You sell your peace of art, To the art muesem.");
      ART[playerid]--;
      GivePlayerMoney(playerid,50);
      SendClientMessage(playerid,COLOR_GREEN,"+50 USD.");
      SendClientMessage(playerid,COLOR_GREEN,"________________________________________________________");
    }
    else SendClientMessage(playerid,COLOR_GREEN,"You don't have an art to sell!");
    return 1;
  }
Reply
#4

Tyvm all, Once i get paypal i will pay you guys a dollar or two XD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)