SA-MP Forums Archive
BUGS/ERRORS!!? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: BUGS/ERRORS!!? (/showthread.php?tid=371117)



BUGS/ERRORS!!? - Windrush - 22.08.2012

Guys I have Problems with this errors/bugs

I will gonna Pm my Friend like this


Then when i will gonna Enter it it says like this


and my pawn code is like this
pawn Code:
CMD:pm(playerid,params[])
{
    new giveplayerid, inputtext[256];
    if (sscanf(params, "us", giveplayerid, inputtext)) return Inter_SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /pm [PlayerID] [Message]");

    if(giveplayerid == playerid) return
    Inter_SendClientMessage(playerid, red, "ERROR: You can't send PM to yourself!");

    if(!(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)) return
    Inter_SendClientMessage(playerid, red, "ERROR: Player not Connected!");
    PMplayer1 = giveplayerid;
    GetPlayerName(giveplayerid, PmReceiver, sizeof(PmReceiver));
    OnPlayerPrivmsg(playerid, giveplayerid, inputtext);
/*  new string[128];
    format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:", PmReceiver, PMplayer1);
    ShowPlayerDialog(playerid,DIALOG_TYPE_PM,DIALOG_STYLE_INPUT,"PrivateMessage",string,"Send!","Cancel");*/

    return 1;
}
#endif
second errors/bugs

i download the radio fs but he dont have scroll bar like this


but the pawn code is like this
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(!response) return 1;
    if(dialogid == DEIALOG_ID)
    {
        if(listitem == sizeof(radiolist)) return OnPlayerCommandText(playerid,"/radio");
            if(listitem == sizeof(radiolist)+1) return StopAudioStreamForPlayer(playerid),Radio[playerid] = false;
            StopAudioStreamForPlayer(playerid);
            PlayAudioStreamForPlayer(playerid,radiolist[listitem][0]);
            new str[50]; format(str,50,"Now listening to \"%s\"...",radiolist[listitem][1]);
            SendClientMessage(playerid,0x33CCFFAA,str);
            SendClientMessage(playerid,0xFFFFFFAA,"Stop listening: /MOFF");
            Radio[playerid] = true;
            return 1;
    }

Please reply quickly


Re: BUGS/ERRORS!!? - Windrush - 22.08.2012

Anyone?


Re: BUGS/ERRORS!!? - Universal - 22.08.2012

EDIT: OnPlayerPrivmsg was removed in SA-MP 0.3. See below how to create a /pm command.

pawn Code:
if(!strcmp("/pm", cmdtext, true))
{
    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;
}
From SA-MP Wiki.


Re: BUGS/ERRORS!!? - Windrush - 22.08.2012

how about the scroll bar?


Re: BUGS/ERRORS!!? - Universal - 22.08.2012

I dont know, I cant imagine the code of that FS and edit it in my thoughts.


Re: BUGS/ERRORS!!? - Ranama - 22.08.2012

Quote:
Originally Posted by windrush
View Post
how about the scroll bar?
Are you sure there are more radio stations in that filterscript?


Re: BUGS/ERRORS!!? - Vince - 22.08.2012

You can see that it cuts of at {FA (the start of an embedded color tag) which indicates that the output string is not big enough.


Re: BUGS/ERRORS!!? - Windrush - 23.08.2012

how to fix it?


Re: BUGS/ERRORS!!? - HuSs3n - 23.08.2012

show your /radio command lines


Re: BUGS/ERRORS!!? - Akira297 - 23.08.2012

Quote:
Originally Posted by HuSs3n
View Post
show your /radio command lines
It wouldn't be the command line, that we would need.

It would have to be on the dialog.

Code:
if(dialogid == [nameOfRadioDialog])