Why's this 'CallRemoteFunction' giving me a mismatch error?
#1

Title, I don't see any issues using it..

PHP код:
CallRemoteFunction(return_callback"i"playerid); 
Full code;

fade.pwn
PHP код:
static PlayerText:playerFadeScreen[MAX_PLAYERS];
SetPlayerToFade(const playerid, const interval, const return_callback[]) {
    
PlayerTextDrawDestroy(playeridplayerFadeScreen[playerid]);
    
playerFadeScreen[playerid] = CreatePlayerTextDraw(playerid,0.0000000.000000"_");
    
PlayerTextDrawBackgroundColor(playeridplayerFadeScreen[playerid], 255);
    
PlayerTextDrawFont(playeridplayerFadeScreen[playerid], 1);
    
PlayerTextDrawLetterSize(playeridplayerFadeScreen[playerid], 0.50000064.000000);
    
PlayerTextDrawColor(playeridplayerFadeScreen[playerid], -1);
    
PlayerTextDrawSetOutline(playeridplayerFadeScreen[playerid], 0);
    
PlayerTextDrawSetProportional(playeridplayerFadeScreen[playerid], 1);
    
PlayerTextDrawSetShadow(playeridplayerFadeScreen[playerid], 1);
    
PlayerTextDrawUseBox(playeridplayerFadeScreen[playerid], 1);
    
PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000011);
    
PlayerTextDrawTextSize(playeridplayerFadeScreen[playerid], 640.0000000.000000);
    
PlayerTextDrawSetSelectable(playeridplayerFadeScreen[playerid], 0);
    
SetTimerEx("@OnPlayerRefreshScreen"interval/20false"iiis"playeridinterval/200return_callback);
}
forward @OnPlayerRefreshScreen(playeridintervalstagereturn_callback);
@
OnPlayerRefreshScreen(playeridintervalstagereturn_callback) {
    if(
stage 28) {
        if(
stage == 14)
            
CallRemoteFunction(return_callback"i"playerid);
        
SetTimerEx("@OnPlayerRefreshScreen"intervalfalse"iii"playeridintervalstage+1);
        switch(
stage) {
            case 
0PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000011);
            case 
1PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000022);
            case 
2PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000033);
            case 
3PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000044);
            case 
4PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000055);
            case 
5PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000066);
            case 
6PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000077);
            case 
7PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000088);
            case 
8PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000099);
            case 
9PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000AA);
            case 
10PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000BB);
            case 
11PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000CC);
            case 
12PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000DD);
            case 
13PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000EE);
            case 
14PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000FF);
            case 
15PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000EE);
            case 
16PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000DD);
            case 
17PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000CC);
            case 
18PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000BB);
            case 
19PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x000000AA);
            case 
20PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000099);
            case 
21PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000088);
            case 
22PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000077);
            case 
23PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000066);
            case 
24PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000055);
            case 
25PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000044);
            case 
26PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000033);
            case 
27PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000022);
            case 
28PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], 0x00000011);
        }
    }
    else
        
PlayerTextDrawDestroy(playeridplayerFadeScreen[playerid]);

And this is how I use it:

roleplay.pwn
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
    switch(
dialogid) {
        case 
DIALOG_LOGIN: {
            if(
response) {
                if(!
strempty(inputtext)) {
                    static 
password[256];
                    
SHA256_PassHash(inputtext"removed for samp forums"passwordsizeof password);
                    if(!
strcmp(passwordplayerData[playerid][playerPassword], false)) {
                        
playerData[playerid][playerActive] = true;
                        
SpawnPlayer(playerid);
                        
SetPlayerToFade(playerid2000"OnPlayerFinishFade");
                    }
                    else 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Lexus-Gaming: Roleplay""{A1C1D1}Welcome back,\n please enter your password below to login and play.\n \n"HEXWINE"Your credentials doesn't match up.""Submit""Cancel");
                }
                else 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Lexus-Gaming: Roleplay""{A1C1D1}Welcome back,\n please enter your password below to login and play.\n \n"HEXWINE"You must enter a password.""Submit""Cancel");
            }
            else {
                
SendClientMessage(playeridCOLOR_WINE"You've been kicked for the following reason..");
                
SendClientMessage(playeridCOLOR_WINE" - You failed to properly log in to your account.");
                
KickPlayer(playerid);
            }
            return 
1;
        }
    }
    return 
0;

Reply
#2

PHP код:
CallRemoteFunction("return_callback""i"playerid); 
Reply
#3

Quote:
Originally Posted by rfr
Посмотреть сообщение
PHP код:
CallRemoteFunction("return_callback""i"playerid); 
No, not really.. that would make the server call the callback called 'return_callback' and not the callback in the variable return_callback which is given upon calling 'SetPlayerToFade'.
Reply
#4

it should be a string:

PHP код:
forward @OnPlayerRefreshScreen(playeridintervalstage, const return_callback[]);
@
OnPlayerRefreshScreen(playeridintervalstage, const return_callback[]) { 
and:

PHP код:
SetTimerEx("@OnPlayerRefreshScreen"intervalfalse"iiis"playeridintervalstage+1return_callback); 
Reply
#5

Quote:
Originally Posted by OneDay
Посмотреть сообщение
it should be a string:

PHP код:
forward @OnPlayerRefreshScreen(playeridintervalstage, const return_callback[]);
@
OnPlayerRefreshScreen(playeridintervalstage, const return_callback[]) { 
and:

PHP код:
SetTimerEx("@OnPlayerRefreshScreen"intervalfalse"iiis"playeridintervalstage+1return_callback); 
Oh yeah, totally missed that out! Thanks, bud.
Reply
#6

PHP код:
        static const stageColours[29] = {
            
0x000000110x000000220x000000330x000000440x000000550x000000660x00000077,
            
0x000000880x000000990x000000AA0x000000BB0x000000CC0x000000DD0x000000EE,
            
0x000000FF0x000000EE0x000000DD0x000000CC0x000000BB0x000000AA0x00000099,
            
0x000000880x000000770x000000660x000000550x000000440x000000330x00000022,
            
0x00000011 };
        
PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], stageColours[stage]);
        
// I think you need to show again
        
PlayerTextDrawShow(playeridplayerFadeScreen[playerid]); 
Reply
#7

Quote:
Originally Posted by OneDay
Посмотреть сообщение
PHP код:
        static const stageColours[29] = {
            
0x000000110x000000220x000000330x000000440x000000550x000000660x00000077,
            
0x000000880x000000990x000000AA0x000000BB0x000000CC0x000000DD0x000000EE,
            
0x000000FF0x000000EE0x000000DD0x000000CC0x000000BB0x000000AA0x00000099,
            
0x000000880x000000770x000000660x000000550x000000440x000000330x00000022,
            
0x00000011 };
        
PlayerTextDrawBoxColor(playeridplayerFadeScreen[playerid], stageColours[stage]);
        
// I think you need to show again
        
PlayerTextDrawShow(playeridplayerFadeScreen[playerid]); 
Thanks bud, appreciate it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)