Help Me Please Login/Register - 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 Me Please Login/Register (
/showthread.php?tid=573218)
Help Me Please Login/Register -
Ale1234 - 05.05.2015
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, PlayerInfo[playerid][100]);
SetPlayerArmour(playerid, PlayerInfo[playerid][5]);
GivePlayerMoney(playerid, PlayerInfo[playerid][250000]);
return 1;
}
Errors
Код:
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(289) : warning 217: loose indentation
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(302) : warning 217: loose indentation
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(318) : warning 217: loose indentation
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(328) : error 029: invalid expression, assumed zero
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(328) : warning 215: expression has no effect
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(328) : error 001: expected token: ";", but found "]"
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(328) : error 029: invalid expression, assumed zero
C:\Users\Ewony\Desktop\New folder\filterscripts\Login.pwn(328) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Help Me Please Login/Register -
ihatetn931 - 05.05.2015
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 5);
GivePlayerMoney(playerid, 250000);
return 1;
}
If you wanna use PlayerInfo[playerid][]
You need an enum
pawn Код:
enum pInfo
{
playerName[24],
playerMoney,
Float:playerHealth,
Float:playerArmour,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Then you would do
pawn Код:
PlayerInfo[playerid][playerMoney];
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, PlayerInfo[playerid][playerHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][playerArmour]);
GivePlayerMoney(playerid, PlayerInfo[playerid][playerMoney]);
return 1;
}
To do that, when they register you set the the amount you want on each, so
pawn Код:
forward OnPlayerRegister(playerid);
public OnPlayerResgister(playerid)
{
PlayerInfo[playerid][playerMoney] = 250000;
PlayerInfo[playerid][playerHealth] = 100;
PlayerInfo[playerid][playerArmour] = 5;
return 1;
}
Re: Help Me Please Login/Register -
Ale1234 - 05.05.2015
It Workґs tnx