What's Wrong...?
#1

Okay, I Scripted This A While Back
And It's Never Worked
Everytime I Go IG And Type /ask Test

It Comes Up [QUESTION]John Sanders Has asked a Question: [Question: .]

It Only Comes Up with Teh Dot..

So here is The Code And help Would be Much Appreciated. =D


pawn Код:
if(strcmp(cmd,"/ask",true,4)==0) // Ask's a Question
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_TAN, "Correct Usage: /ask [Question]");
            return 1;
        }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new question[128];
            question = bigstrtok(cmdtext, idx);
            format(string, sizeof(string), "[QUESTION] %s has Asked a Question: [Question: %s.]", sendername,question);
            SendClientMessageToAdmins(COLOR_TAN, string,2);
            SendClientMessage(playerid, COLOR_TAN, "Your Question Has been Sent To The Current Online Admins.");
            return 1;
        }

-John
Reply
#2

Hmm, it looks fine.

What's the SendClientMessageToAdmins? (Show the code)
Reply
#3

Hmm, I also canґt see nothing wrong. question is for %s..

Well, maybe change this line to the following:

format(string, sizeof(string), "[QUESTION] %s has Asked a Question: [Question: %s]", sendername,question);
Reply
#4

I'm thinking the format is fine, but the function "SendClientMessageToAdmins" is interfering with it somehow. Post the code for that.
Reply
#5

Quote:
Originally Posted by Grim_
I'm thinking the format is fine, but the function "SendClientMessageToAdmins" is interfering with it somehow. Post the code for that.
pawn Код:
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (AccountInfo[i][AdminLevel] >= alevel)
            {
                SendClientMessage(i, color, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
I'm Currently Using The SeifAdmin FS For This.
Reply
#6

So why are you using it like this
Код:
SendClientMessageToAdmins(COLOR_TAN, string,2);
Try changing it to
Код:
SendClientMessageToAdmins(COLOR_TAN, string);
Reply
#7

Try this
pawn Код:
if(strcmp(cmd,"/ask",true,4)==0) // Ask's a Question
{
    if(!cmdtext[4])
    {
        SendClientMessage(playerid, COLOR_TAN, "Correct Usage: /ask [Question]");
        return 1;
    }

    new
        sendername[MAX_PLAYER_NAME],
        new string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, sizeof(string), "[QUESTION] %s has Asked a Question: [Question: %s.]", sendername, cmdtext[4]);
    SendClientMessageToAdmins(COLOR_TAN, string,2);
    SendClientMessage(playerid, COLOR_TAN, "Your Question Has been Sent To The Current Online Admins.");
    return 1;
}
Reply
#8

Quote:
Originally Posted by dice7
Try this
pawn Код:
if(strcmp(cmd,"/ask",true,4)==0) // Ask's a Question
{
    if(!cmdtext[4])
    {
        SendClientMessage(playerid, COLOR_TAN, "Correct Usage: /ask [Question]");
        return 1;
    }

    new
        sendername[MAX_PLAYER_NAME],
        new string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, sizeof(string), "[QUESTION] %s has Asked a Question: [Question: %s.]", sendername, cmdtext[4]);
    SendClientMessageToAdmins(COLOR_TAN, string,2);
    SendClientMessage(playerid, COLOR_TAN, "Your Question Has been Sent To The Current Online Admins.");
    return 1;
}
One Error

pawn Код:
C:\Documents and Settings\******\*******\******************\filterscripts\SeifAdmin.pwn(1131) : error 001: expected token: "-identifier-", but found "new"

Line:

pawn Код:
new string[128];
Reply
#9

new sendername[MAX_PLAYER_NAME];
new string[128];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)