Pawno error?
#1

I got this error here'

Код:
C:\Users\Adam Elliott\Desktop\RPServer\filterscripts\s_commands.pwn(102) : error 029: invalid expression, assumed zero
C:\Users\Adam Elliott\Desktop\RPServer\filterscripts\s_commands.pwn(102) : error 029: invalid expression, assumed zero
C:\Users\Adam Elliott\Desktop\RPServer\filterscripts\s_commands.pwn(102) : error 001: expected token: ")", but found ";"
C:\Users\Adam Elliott\Desktop\RPServer\filterscripts\s_commands.pwn(102) : fatal error 107: too many error messages on one line

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


4 Errors.


Heres the code:
Код:
if(!strcmp("/pm", cmdtext, true))
{
Error Line --->   tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
    new id = strval(tmp);
    gMessage = strrest(cmdtext,idx);
    if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");
    GetPlayerName(id,iName,sizeof(iName));
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
    SendClientMessage(playerid,0xFFD720FF,Message);
    format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
    SendClientMessage(id,0xFFD720FF,Message);
    PlayerPlaySound(id,1085,0.0,0.0,0.0);
    return 1;
}
Reply
#2

Where's the error line ?
Reply
#3

Quote:
Originally Posted by Kiyozi_Mu
Посмотреть сообщение
Where's the error line ?
Il edit it and arrow it, sorry
Reply
#4

Done
Reply
#5

Try
pawn Код:
if(!strcmp("/pm", cmdtext, true, 10) == 0)
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
    new id = strval(tmp);
    gMessage = strrest(cmdtext,idx);
    if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");
    GetPlayerName(id,iName,sizeof(iName));
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
    SendClientMessage(playerid,0xFFD720FF,Message);
    format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
    SendClientMessage(id,0xFFD720FF,Message);
    PlayerPlaySound(id,1085,0.0,0.0,0.0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)