04.11.2016, 01:50
Here's my new OPC
Did I do it correctly?
PHP код:
public OnPlayerConnect(playerid)
{
if(!IsPlayerNPC(playerid))
{
GangZoneShowForPlayer(playerid, BlackRadar, 0x000000FF);
pInfo[playerid][zMoney] = 0;
pInfo[playerid][pAdminLevel] = 0;
pInfo[playerid][ZombiesKilled] = 0;
pInfo[playerid][HumansKilled] = 0;
pInfo[playerid][HumanDeaths] = 0;
pInfo[playerid][ZombieDeaths] = 0;
pInfo[playerid][pPremium] = 0;
pInfo[playerid][pX] = 0.0;
pInfo[playerid][pY] = 0.0;
pInfo[playerid][pZ] = 0.0;
pInfo[playerid][pPM] = 0;
pInfo[playerid][pHour] = 0;
pInfo[playerid][pSec] = 0;
pInfo[playerid][pMin] = 0;
pInfo[playerid][Muted] = 0;
pInfo[playerid][Warnings] = 0;
pInfo[playerid][pLogged] = false;
pInfo[playerid][pNMute] = 0;
pInfo[playerid][pNMuteTotal] = 0;
pInfo[playerid][pBanned] = 0;
pInfo[playerid][pVote] = 0;
pInfo[playerid][VotedPlayer] = 0;
pInfo[playerid][pMask] = 0;
pInfo[playerid][pMaskOn] = 0;
pInfo[playerid][pCookies] = 0;
pInfo[playerid][pJailed] = 0;
pInfo[playerid][pJailTime] = 0;
pInfo[playerid][FirstPS] = 0;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(fexist(Path(playerid)))
{
INI_String("Password", pInfo[playerid][Password],129);
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Welcome back to "COL_LRED""SERVER_NAME" "SERVER_VERSION""COL_WHITE". This account is registered. \nInsert your password to login to your account","Login","Quit");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Register","Welcome to "COL_LRED""SERVER_NAME" "SERVER_VERSION""COL_WHITE"! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
return 1;
}
}
return 1;
}