Help OnPlayer Connect - 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: Help OnPlayer Connect (
/showthread.php?tid=531157)
Help OnPlayer Connect -
Naresh - 11.08.2014
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)
Re: Help OnPlayer Connect -
CutX - 11.08.2014
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));