SA-MP Forums Archive
Help, I'm new :) - 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, I'm new :) (/showthread.php?tid=111038)



Help, I'm new :) - rakehunt - 29.11.2009

Hey guys, im new in scripting and i need some help.
I wrote a easy script which should say:"Hi to everybody!" if i write /hey ingame.
but i dont know where to put in this file now and what format it needs...
please help me

greetz rakehunt


Re: Help, I'm new :) - BP13 - 29.11.2009

pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
dcmd_hi(playerid, params[])
{
    #pragma unused params
    new name[MAX_PLAYER_NAME+1];
    new String[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(String, sizeof(String), "%s says hi!", name);
    SendClientMessageToAll(0xAFAFAFAA, String);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(hi, 2, cmdtext);
    return 0;
}



Re: Help, I'm new :) - BP13 - 29.11.2009

Put the DCMD Define at the top

Put the dcmd_hi command at the very bottm

put dcmd(hi, 2, cmdtext); under onplayercommandtext


Re: Help, I'm new :) - rakehunt - 29.11.2009

i still dont know where i need to put the whole file and which format it needs ..


Re: Help, I'm new :) - Joe Staff - 29.11.2009

I'm sure I'm stating the obvious when I say this, but you have to 'compile' a .pwn (created by pawn compilers like Pawno) which turns the .pwn into a .amx, the .amx is what is required for the script to be executable by the server.


Re: Help, I'm new :) - rakehunt - 29.11.2009

how can i do that?


Re: Help, I'm new :) - Joe Staff - 29.11.2009

hit the 'compile' button in pawno...


Re: Help, I'm new :) - BP13 - 29.11.2009

If its such a strain for you then just copy what I posted and paste it in a blank pawno file and compile it. Oh and put #include <a_samp> on the top.


Re: Help, I'm new :) - [GM]The_Don - 29.11.2009

Код:
  //At The Top of your Script
  #define COLOR_WHITE 0xFFFFFFAA
  //Under OnPlayerCommandText
  if (strcmp(cmdtext, "/hey", true)==0)
  {
  SendClientMessageToAll(COLOR_WHITE,"Hi to Everybody");
  return 1;
  }
  //Script by [GM]The_Don © 2009 SA-MP Forums
Or just use this, if you dont have dcmd. Just Hit the Compile Button and your Set
regards
[GM]The_Don


Re: Help, I'm new :) - laserhel50 - 30.11.2009

Quote:
Originally Posted by [GM
The_Don ]
Код:
  //At The Top of your Script
  #define COLOR_WHITE 0xFFFFFFAA
  //Under OnPlayerCommandText
  if (strcmp(cmdtext, "/hey", true)==0)
  {
  SendClientMessageToAll(COLOR_WHITE,"Hi to Everybody");
  return 1;
  }
  //Script by [GM]The_Don © 2009 SA-MP Forums
Or just use this, if you dont have dcmd. Just Hit the Compile Button and your Set
regards
[GM]The_Don
i dont think that new scripters use dcmd xD even i use the OnPlayerCommandText way