Help OnPlayer Connect
#1

pawn Код:
// Setup local variables
    new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID, IP;

    // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints
    SetPVarInt(playerid, "PVarMoney", 0);
    SetPVarInt(playerid, "PVarScore", 0);

    // Get the playername
    GetPlayerName(playerid, Name, sizeof(Name));
    // Also store this name for the player
    GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);
    // Add the IP of the player to the list
    GetPlayerIp(playerid, IP, sizeof(IP));
Errors -

pawn Код:
F:\TW-Server Related\Scripting\Trucking World\gamemodes\TW.pwn(397) : error 035: argument type mismatch (argument 2)
F:\TW-Server Related\Scripting\Trucking World\gamemodes\TW.pwn(397) : error 035: argument type mismatch (argument 2)
Reply
#2

Quote:
Originally Posted by Naresh
Посмотреть сообщение
pawn Код:
// Setup local variables
    new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID, IP;

    // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints
    SetPVarInt(playerid, "PVarMoney", 0);
    SetPVarInt(playerid, "PVarScore", 0);

    // Get the playername
    GetPlayerName(playerid, Name, sizeof(Name));
    // Also store this name for the player
    GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);
    // Add the IP of the player to the list
    GetPlayerIp(playerid, IP, sizeof(IP));
Errors -

pawn Код:
F:\TW-Server Related\Scripting\Trucking World\gamemodes\TW.pwn(397) : error 035: argument type mismatch (argument 2)
F:\TW-Server Related\Scripting\Trucking World\gamemodes\TW.pwn(397) : error 035: argument type mismatch (argument 2)


The IP is a string cuz its got dots.
You have to do it like this

pawn Код:
new IP[16];
GetPlayerIp(playerid, IP, sizeof(IP));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)