Who can help me?
#1

I need some help to create a newbie chat for my server.
Reply
#2

Define it briefly?
Reply
#3

Quote:
Originally Posted by Shannkz
Посмотреть сообщение
I need some help to create a newbie chat for my server.
pawn Код:
#include <zcmd>
#include <sscanf>

new *name of the var/string*;
pawn Код:
COMMAND:yourcommand(playerid, params[])
{
    new tmpstring[164], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "s[128]", tmpstring))
    {
        SendClientMessage(ANGRY_COLOR, ERROR_RED, "ERROR: Usage /n [message]");
        return 1;
    }
    else
    {
        format(tmpstring, sizeof(tmpstring), "(NEWBIE) %s: %s ", name, tmpstring);
        SendClientMessageToAll(GetPlayerColor(playerid), tmpstring);
    }
    return 1;
}
Credits to FalconX
Reply
#4

Quote:
Originally Posted by kbalor
Посмотреть сообщение
pawn Код:
#include <zcmd>
#include <sscanf>

new *name of the var/string*;
[PAW]COMMAND:yourcommand(playerid, params[])
{
new tmpstring[164], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(params, "s[128]", tmpstring))
{
SendClientMessage(ANGRY_COLOR, ERROR_RED, "ERROR: Usage /n [message]");
return 1;
}
else
{
format(tmpstring, sizeof(tmpstring), "(NEWBIE) %s: %s ", name, tmpstring);
SendClientMessageToAll(GetPlayerColor(playerid), tmpstring);
}
return 1;
}[/PAWN]
Credits to FalconX
Serisusly use pawn code i haven't either understood one line
Reply
#5

DCMD

pawn Код:
dcmd_ask(playerid,params[])
{
    new str[80];
    if(sscanf(params,"s[80]",str)) SendClientMessage(playerid,-1,"Usage : /ask [HELP]");
    new name[MAX_PLAYER_NAME],msg[110];
    GetPlayerName(playerid,name,20);
    format(msg,sizeof(msg),"[HELP]%s(%d) : %s",name,playerid,str);
    for(new i=0;i<MAX_PLAYERS;++i)
    {
        if(IsPlayerConnected(i) && (pInfo[i][Admin] >0 || IsPlayerAdmin(i))
            SendClientMessage(i,-1,msg);
    }
    SendClientMessage(playerid,-1, "Your Question has been sent, Please be calm till you recieve a response.");

    return 1;
}
Reply
#6

This is what I get when I try to build
Код:
fatal error 100: cannot read from file: "zcmd"
Reply
#7

Quote:
Originally Posted by Shannkz
Посмотреть сообщение
This is what I get when I try to build
Код:
fatal error 100: cannot read from file: "zcmd"
Make sure you open the right pawn and try to compile it again, and make sure you have downloaded zmcd
http://www.solidfiles.com/d/879d1213...6d464e90c8cf9/
Reply
#8

Ok, after I downloaded zcmd and placed it in the include folder, I get this

Код:
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1813) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1838) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1875) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1930) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1955) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1990) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2005) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2030) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2050) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2282) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2346) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\utils.inc(52) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(1975) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(2006) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(2072) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(2226) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(3930) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(4608) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(5953) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(6711) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(7478) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(8799) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(8909) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(8981) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(24113) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(33985) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(34754) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39483) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39483) : error 017: undefined symbol "cmd"
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39485) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39486) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39487) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39487) : error 017: undefined symbol "params"
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39489) : error 017: undefined symbol "ANGRY_COLOR"
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39502) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39532) : warning 203: symbol is never used: "name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#9

Quote:
Originally Posted by Shannkz
Посмотреть сообщение
Ok, after I downloaded zcmd and placed it in the include folder, I get this

Код:
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1813) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1838) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1875) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1930) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1955) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(1990) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2005) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2030) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2050) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2282) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\JunkBuster.inc(2346) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\pawno\include\utils.inc(52) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(1975) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(2006) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(2072) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(2226) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(3930) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(4608) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(5953) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(6711) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(7478) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(8799) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(8909) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(8981) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(24113) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(33985) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(34754) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39483) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39483) : error 017: undefined symbol "cmd"
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39485) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39486) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39487) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39487) : error 017: undefined symbol "params"
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39489) : error 017: undefined symbol "ANGRY_COLOR"
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39502) : warning 217: loose indentation
C:\Documents and Settings\YkZBoY\Desktop\dec-lands\gamemodes\decv0115n2.pwn(39532) : warning 203: symbol is never used: "name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Can you show what is in the top of your gamemode?
Example

#include <a_samp>
//so on....
Reply
#10

Here it is

Код:
#include <a_samp>
#include <a_npc>
#include <core>
#include <ChatColor>
#include <Dini>
#include <float>
#include <file>
#include <JunkBuster>
#include <morphinc>
#include <time>
#include <utils>
#include <zcmd>
#include <sscanf>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)