Help, I'm new :)
#1

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

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

Put the DCMD Define at the top

Put the dcmd_hi command at the very bottm

put dcmd(hi, 2, cmdtext); under onplayercommandtext
Reply
#4

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

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.
Reply
#6

how can i do that?
Reply
#7

hit the 'compile' button in pawno...
Reply
#8

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.
Reply
#9

Код:
  //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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)