pawn Код:
OnPlayerLogin(playerid)
{
new string [128];
TotalLogin++;
ResetPlayerMoney(playerid);
CurrentMoney[playerid] = GetPVarInt(playerid, "Cash");
HideMenuLogin(playerid);
if(Info[playerid][pLvlAdminZC] > 0)
{
Info[playerid][pLvlAdminZC] = 0;
Info[playerid][pAdminZC] = 0;
Info[playerid][pBanAppealer] = 0;
Info[playerid][pFactionModerator] = 0;
Info[playerid][pGangModerator] = 0;
Info[playerid][pShopTech] = 0;
Info[playerid][pHelper] = 0;
SendClientMessageEx(playerid, COLOR_WHITE,"SERVER: Restauraciуn de administradores general. No reportar esto.");
}
if(Info[playerid][pDisabledZC] == 1){
SetPlayerName(playerid, "BannedPlayer");
SendClientMessageEx(playerid, COLOR_GENERAL,"Error [#12]");
SendClientMessageEx(playerid, COLOR_WHITE, "Esta cuenta estб deshabilitada.");
Kick(playerid);
}
if(Info[playerid][pBannedZC] >= 2){
SetPlayerName(playerid, "BannedPlayer");
SendClientMessageEx(playerid, COLOR_GENERAL,"Error [#10]");
SendClientMessageEx(playerid, COLOR_WHITE, "SERVER: Tъ estбs baneado del servidor.");
Kick(playerid);
}
if(Info[playerid][pAdminZC] > 0){
new tempip[32];
GetPlayerIp(playerid, tempip, 32);
if(strcmp(tempip, Info[playerid][pIP], true)){
format(string, sizeof(string), "%s ha logueado con diferente [IP: %s] - IP original es: %s", GetPlayerNameEx(playerid), tempip, Info[playerid][pIP]);
ABroadCast(COLOR_GENERAL, string, 4);
}
}
if(Info[playerid][pWRestricted] >= 1) ResetPlayerWeaponsEx(playerid);
if(Info[playerid][pAccount] >= 50000) Info[playerid][pAccount] -= 10;
GetPlayerIp(playerid, Info[playerid][pIP], 32);
SetPlayerScore(playerid, Info[playerid][pLevel]);
if(Info[playerid][pReg] == 0){
Info[playerid][pLevel] = 0;
Info[playerid][pHealth] = 100.0;
Info[playerid][pPos_x] = 1612.3240;
Info[playerid][pPos_y] = -2330.1670;
Info[playerid][pPos_z] = 13.5469;
Info[playerid][pInt] = 0;
Info[playerid][pTeam] = 3;
Info[playerid][pChar] = 299;
Info[playerid][pPnumber] = 0;
Info[playerid][pPhousekey] = INVALID_HOUSE_ID;
Info[playerid][pPhousekey2] = INVALID_HOUSE_ID;
Info[playerid][pAccount] = 0;
}
if(Info[playerid][pPos_x] == 0.0 && Info[playerid][pPos_y]== 0.0&& Info[playerid][pPos_z]== 0.0){
Info[playerid][pPos_x] = 1715.12;
Info[playerid][pPos_y] = -1903.17;
Info[playerid][pPos_z] = 13.56;
}
//TextDrawShowForPlayer(playerid,RolPoint1[playerid]);
TextDrawShowForPlayer(playerid,RolPoint2[playerid]);
TextDrawShowForPlayer(playerid,RolPoint3[playerid]);
TextDrawShowForPlayer(playerid,RolPoint4[playerid]);
TextDrawShowForPlayer(playerid,RolPoint5[playerid]);
//TextDrawShowForPlayer(playerid, BalanceTextDraw[playerid] );
if(Info[playerid][pShopTech] >= 2) Info[playerid][pShopTech] = 0;
if(Info[playerid][pAdminZC] == 0) { Info[playerid][pGangModerator] = 0; Info[playerid][pShopTech] = 0; Info[playerid][pBanAppealer] = 0; Info[playerid][pFactionModerator] = 0; }
if(Info[playerid][pHospital] == 1){ Info[playerid][pHospital] = 0; SetPVarInt(playerid, "Hospital", 1); }
if(Info[playerid][pLevel] < 5 || Info[playerid][pAdminZC] > 0 || Info[playerid][pHelper] > 0) gNewbie[playerid] = 0;
if(Info[playerid][pNMute] == 1) SetTimerEx("NewbieUnMuted", 300000, 0, "d", playerid);
if(Info[playerid][pTut] == 1) Info[playerid][pReg] = 1;
if(Info[playerid][pVIP] == 0 && Info[playerid][pJob2] >= 1) Info[playerid][pJob2] = 0; // Reset Job if heґs lost the VIP
new text[128];
switch(Info[playerid][pAdminZC]) // Mensaje de bienvenida
{
case 1: SendClientMessage(playerid, -1, "{ffffff}Bienvenido, te has conectado como Moderador.");
case 2, 3, 4, 5, 1337, 1338, 99999: SendClientMessage(playerid, -1, def("{ffffff}Bienvenido, te has conectado como administrador nivel %d.", Info[playerid][pAdminZC]));
default: SendClientMessage(playerid, -1, def("{ffffff}Bienvenido a nuestro servidor, %s.", GetPlayerNameEx(playerid)));
}
switch(Info[playerid][pHelper]){
case 1: SendClientMessageEx(playerid, COLOR_WHITE, "{ffffff}Te has conectado como ayudante.");
case 2: SendClientMessageEx(playerid, COLOR_WHITE, "{ffffff}* Te has conectado como Lider de Ayudantes.");
}
SendClientMessageEx(playerid, COLOR_RED, GlobalMOTD);
CheckVIPExpire(playerid); // Check VIP Expire
if(Info[playerid][pVIP] >= 1) SendClientMessageEx(playerid, COLOR_VIP, VIPMOTD);
if(gTeam[playerid] == 0){
gTeam[playerid] = 3;
}
else{
gTeam[playerid] = Info[playerid][pTeam];
}
SetSpawnInfo(playerid, Info[playerid][pTeam], Info[playerid][pChar], Info[playerid][pPos_x], Info[playerid][pPos_y], Info[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
gPlayerLogged{playerid} = 1;
SpawnPlayer(playerid);
new ip[32], tmp2[128];
GetPlayerIp(playerid, ip, 32);
if(Info[playerid][pAdminZC] >= 1) SendClientMessageEx(playerid, TEAM_AZTECAS_COLOR, AdminMOTD);
if(Info[playerid][pHelper] >= 1) SendClientMessageEx(playerid, TEAM_AZTECAS_COLOR, CAMOTD);
if(Info[playerid][pFMember] < 255){
format(tmp2, sizeof(tmp2), "Mensaje Familia: %s.", fINFO[Info[playerid][pFMember]][FamilyMOTD]);
SendClientMessageEx(playerid, COLOR_YELLOW, tmp2);
}
if(Info[playerid][pMember] > 0){
format(tmp2, sizeof(tmp2), "Admin Msj: %s.", FACMOTD);
SendClientMessageEx(playerid, COLOR_YELLOW, tmp2);
}
if(Info[playerid][pFMember] < 255){
format(tmp2, sizeof(tmp2), "Admin Msj: %s.", FAMMOTD);
SendClientMessageEx(playerid, COLOR_YELLOW, tmp2);
}
if(Info[playerid][pOrder] > 0){
format(string, sizeof(string), "SERVER: %s estб esperando por su compra en la tienda.",GetPlayerNameEx(playerid));
ShopTechBroadCast(COLOR_SHOP,string);
}
if(Info[playerid][pVIP] >= 4 && Info[playerid][pArmsSkill] < 400){
Info[playerid][pArmsSkill] = 401;
SendClientMessageEx(playerid, COLOR_YELLOW, "Platinum VIP: Ahora eres nivel 5 en el trabajo Vendedor de Armas.");
}
if(Info[playerid][pJob2] != 0 && Info[playerid][pVIP] == 0){
Info[playerid][pJob2] = 0;
SendClientMessageEx(playerid, COLOR_YELLOW, "Perdiste el trabajo nъmero 2, porque ya no eres VIP.");
}
SetPlayerFightingStyle (playerid, Info[playerid][pFStyle]);
WeedLogin(playerid);
SetPlayerToTeamColor(playerid);
//LoadPlayerVehicles(playerid);
new hcheck, hcheck2, name[MAX_PLAYER_NAME];
hcheck = INVALID_HOUSE_ID;
hcheck2 = INVALID_HOUSE_ID;
GetPlayerName(playerid, name, sizeof(name));
for(new i = 0; i < MAX_HOUSES; i++)
{
if(!strcmp(name, HouseInfo[i][hOwner], false))
{
if(hcheck != INVALID_HOUSE_ID)
{
hcheck2 = i;
}
else
{
hcheck = i;
}
}
}
if(hcheck != INVALID_HOUSE_ID) Info[playerid][pPhousekey] = hcheck;
if(hcheck2 != INVALID_HOUSE_ID) Info[playerid][pPhousekey2] = hcheck2;
if(hcheck == INVALID_HOUSE_ID) return Info[playerid][pPhousekey] = INVALID_HOUSE_ID;
if(hcheck2 == INVALID_HOUSE_ID) return Info[playerid][pPhousekey2] = INVALID_HOUSE_ID;
return 1;
}
Estube editando un gm de ZenonCity ya que estoy completamente aburrido! y cuando puse el ysi fix para la 0.3z me salto esos dos warnings en onplayerlogin que antes no avian saltado !, desde ya muchas gracias
Exite una funcion nativa llamada OnplayerLogin Soloc cambia la tuya por otra ejemplo Onplayerloginxd