29.06.2009, 15:46
Hello, I am in need of some help, I have made an announce script, but I want it to work with Ladmin4v2, I have the include, but every time I try to compile it, I get 1 error and 1 warning I can't fix.
I am a new coder, so I have tried to do this:
EDIT: I read the pawno compiler and fixed a few things, if they are wrong, feel free to correct me.
Code:
C:\Documents and Settings\Administrator\Desktop\AnnounceScript1.pwn(9) : error 017: undefined symbol "cmd" C:\Documents and Settings\Administrator\Desktop\AnnounceScript1.pwn(11) : warning 204: symbol is assigned a value that is never used: "cmd"
Code:
#include <a_samp>
#include <isplayerLadmin>
#include <core>
#pragma tabsize 0
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/at",true)==0)
{
new cmd[128], tmp[512], idx;
strtok(cmdtext, idx);
IsPlayerAdminLevel(playerid, 2);
{
new sendername[128];
new string[128];
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /at message");
return 1;
}
format(string, sizeof(string), "[ ! ] %s", result);
SendClientMessageToAll(0xFF0000FF,string);
}
return 1;
}
return 0;
}

