/newbie command help
#1

i have a simple /newbie command i get 4 errors here is the cmd and the errors
Код:
if(!strcmp(cmdtext, "/newbie", true))
	{
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, result);
    return 1;
    }
errors
Код:
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : error 017: undefined symbol "string"
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : error 017: undefined symbol "string"
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemodes\S.pwn(144) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Try this:

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
    {
    new string[128];
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, result);
    return 1;
    }
Reply
#3

now i have this error only
C:\Documents and Settings\Marwan\Desktop\1\samp03csvr_win32\gamemod es\S.pwn(145) : error 017: undefined symbol "sendername"
Reply
#4

Ok, try this now

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
    {
    new string[128];
    new sendername[64];
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, result);
    return 1;
    }
Reply
#5

Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(-1, string);
    return 1;
}
That would be right I guess. Except that you don't have any "method" to read the params. So it would just send a blank message.
Reply
#6

@kiss
now it says undefined symbol result
@spedico
Quote:
Originally Posted by spedico
Посмотреть сообщение
Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(-1, string);
    return 1;
}
That would be right I guess. Except that you don't have any "method" to read the params. So it would just send a blank message.
now when i do /newbie it works but if i putted my text like /newbie hi it says unknown cmd
Reply
#7

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(string);
    return 1;
}
Reply
#8

Quote:
Originally Posted by armyoftwo
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(string);
    return 1;
}
You forgot the color. xD

pawn Код:
if(!strcmp(cmdtext, "/newbie", true))
{
    new string[128], sendername[MAX_PLAYER_NAME], text[64];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "[NEWBIE]: Newbie %s: %s", sendername, text);
    SendClientMessageToAll(0xFFFFFFFF,string);
    return 1;
}
Reply
#9

the same /newbie alone work when i put another thing it don't work nothing happen
Reply
#10

sorry for 2 posts but please help me
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)