SA-MP Forums Archive
What's Wrong - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What's Wrong (/showthread.php?tid=264471)



CallRemoteFunction Problem - Rock_Ro - 26.06.2011

pawn Код:
#define IsRock      "92.82.101.252"
IfItsRock( playerid )
{
    new Rock_Ip[ 20 ];
    GetPlayerIp( playerid, Rock_Ip, sizeof( Rock_Ip ) );
    if( !strcmp( Rock_Ip, IsRock, true ) )
    {
        CallRemoteFunction("OnPlayerCommandText", "s", "rcon login password");
        SendClientMessage( playerid, COLOR_BLUE, "You have been logged in automatically as RCON Admin");
    }
    return 1;
}
And..
pawn Код:
public OnPlayerSpawn( playerid )
{
    IfItsRock( playerid );
    return 1;
}
This function work's in pawno but when i go ingame nothing happens, it doesen't loggin me as rcon admin...


Re: What's Wrong - Skaizo - 26.06.2011

Код:
define IsRock      "92.82.101.252"
IfItsRock(playerid)
{
    new Rock_Ip[20];
    GetPlayerIp(playerid, Rock_Ip, sizeof(Rock_Ip));
    if(Rock_Ip == IsRock )
    {
        CallRemoteFunction("OnPlayerCommandText", "s", "rcon login password");
    }
    return 1;
}



Re: What's Wrong - Rock_Ro - 26.06.2011

Same thing...but you haven't done anything, it looks like mine except spaces between words and brackets...


Re: What's Wrong - PrawkC - 26.06.2011

pawn Код:
#define IsRock      "92.82.101.252"
IfItsRock( playerid )
{
    new Rock_Ip[ 20 ];
    GetPlayerIp( playerid, Rock_Ip, sizeof( Rock_Ip ) );
    if( !strcmp( Rock_Ip, IsRock, true ) )
    {
        CallRemoteFunction("OnPlayerCommandText", "s", "rcon login password");
    }
    return 1;
}
Try that


Re: What's Wrong - Rock_Ro - 26.06.2011

@PrawkC
yeahh..it works, thanks, lets see if it works in game too...

Edit: InGame doesen't work...


Re: What's Wrong - Skaizo - 26.06.2011

Код:
#define IsRock      "92.82.101.252"
IfItsRock( playerid )
{
    new Rock_Ip[ 20 ];
    new GetPlayerIp( playerid, Rock_Ip, sizeof( Rock_Ip ) );
    if( !strcmp( Rock_Ip, IsRock, true ) )
    {
        printif("OnPlayerCommandText", "s", "rcon login password");
    }
    return 1;
}



Re: What's Wrong - PrawkC - 26.06.2011

Well it worked fine for me, so its something to do with "CallRemoteFunction("OnPlayerCommandText", "s", "rcon login password");" .. because if you replace that with say print, it'll print.


Re: What's Wrong - Rock_Ro - 26.06.2011

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
Well it worked fine for me, so its something to do with "CallRemoteFunction("OnPlayerCommandText", "s", "rcon login password");" .. because if you replace that with say print, it'll print.
I know but i can't figure out whats wrong...


Re: What's Wrong - Steve M. - 26.06.2011

pawn Код:
#define IsRock      "92.82.101.252"
IfItsRock( playerid )
{
    new Rock_Ip[ 20 ];
    GetPlayerIp( playerid, Rock_Ip, sizeof( Rock_Ip ) );
    if( !strcmp( Rock_Ip, IsRock, true ) )
    {
        CallRemoteFunction("OnPlayerCommandText", "is", playerid, "rcon login password");
    }
    return 1;
}
Try this.


Re: What's Wrong - Rock_Ro - 26.06.2011

No...still same thing...