22.03.2012, 21:18
ja tenho os npcs no server... como faзo pra carregar eles no server?
eu uso gamemode BPH me ajuda ai!
eu uso gamemode BPH me ajuda ai!
if(!IsPlayerNPC(playerid)) return 1;
OnPlayerConnect
ou
OnPlayerSpawn
public OnPlayerSpawn(playerid)
{
if(Player[playerid][FirstSpawn] == true)
{
Player[playerid][FirstSpawn] = false;
if(gPlayerLogged[playerid])
{
new lol[256];
format(lol,256,"/RPG/bans/%s.ini", Player[playerid][pName]);
if(strcmp(Player[playerid][pName],"Saci_Deskjet",true)==0)
goto Join;
if(strcmp(Player[playerid][pName],"Rick_Deskjet",true)==0)
goto Join;
if(dini_Exists(lol))
{
new string[128], banfile[256];
new admin[52], data[52], tempban[128];
format(admin,52,"%s", dini_Get(lol,"AdminName"));
format(data,52,"%s", dini_Get(lol,"Data"));
new tick = dini_Int(lol,"BanTime");
if(tick > 0)
{
if(tick < GetTickCount())
format(tempban,128,"|| Ban temporбrio - Acaba em %s", Convert(tick-GetTickCount()));
else
{
SendClientMessage(playerid, COLOR_RED,"[ADMIN BOT] Seu ban temporбrio acabou.");
dini_Remove(lol);
goto Join;
}
}
SendClientMessage(playerid, COLOR_BARRAS,"=============================================================");
format(string,128,"- Esse nick '%s' foi banido pelo '%s' em '%s'", Player[playerid][pName], admin, data);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,128,"- Motivo: '%s' %s", dini_Get(lol, "Motivo"), tempban);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_ORANGE,"Visite a pбgina 'revisao.sampbrasil.com.br', leia as regras e crie seu tуpico com esta imagem. (F8 para capturб-la)");
SendClientMessage(playerid, COLOR_BARRAS,"=============================================================");
banfile = GetBannedFile(playerid);
if(!dini_Exists(banfile) && tick == 0)
{
new hour, minute, second, day, month, year;
gettime(hour, minute, second);
getdate(year, month, day);
dini_Create(banfile);
dini_Set(banfile,"PlayerName", Player[playerid][pName]);
dini_Set(banfile,"AdminName", "Admin Bot");
dini_Set(banfile,"Motivo", "Evasгo de Ban (Old)");
format(string, sizeof(string), "%02d/%02d аs %02d:%02d", day, month, hour, minute);
dini_Set(banfile,"Data", string);
}
return Kick(playerid);
// 1 //
if(!IsPlayerNPC(playerid)) return 1;
new npcname[64];
GetPlayerName(playerid,npcname,64);
if(!strcmp(npcname,"NOME DO NPC",true)) {
SetPlayerSkin(playerid,0); // Skin do Npc
return 1;
}
public OnPlayerSpawn(playerid)
{
if(!IsPlayerNPC(playerid)) return 1;
new npcname[64];
GetPlayerName(playerid,npcname,64);
if(!strcmp(npcname,"NOME DO NPC",true)) {
SetPlayerSkin(playerid,0); // Skin do Npc
return 1;
}
if(Player[playerid][FirstSpawn] == true)
{
Player[playerid][FirstSpawn] = false;
if(gPlayerLogged[playerid])
{
new lol[256];
format(lol,256,"/RPG/bans/%s.ini", Player[playerid][pName]);
if(strcmp(Player[playerid][pName],"Saci_Deskjet",true)==0)
goto Join;
if(strcmp(Player[playerid][pName],"Rick_Deskjet",true)==0)
goto Join;
if(dini_Exists(lol))
{
new string[128], banfile[256];
new admin[52], data[52], tempban[128];
format(admin,52,"%s", dini_Get(lol,"AdminName"));
format(data,52,"%s", dini_Get(lol,"Data"));
new tick = dini_Int(lol,"BanTime");
if(tick > 0)
{
if(tick < GetTickCount())
format(tempban,128,"|| Ban temporбrio - Acaba em %s", Convert(tick-GetTickCount()));
else
{
SendClientMessage(playerid, COLOR_RED,"[ADMIN BOT] Seu ban temporбrio acabou.");
dini_Remove(lol);
goto Join;
}
}
SendClientMessage(playerid, COLOR_BARRAS,"=============================================================");
format(string,128,"- Esse nick '%s' foi banido pelo '%s' em '%s'", Player[playerid][pName], admin, data);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,128,"- Motivo: '%s' %s", dini_Get(lol, "Motivo"), tempban);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_ORANGE,"Visite a pбgina 'revisao.sampbrasil.com.br', leia as regras e crie seu tуpico com esta imagem. (F8 para capturб-la)");
SendClientMessage(playerid, COLOR_BARRAS,"=============================================================");
banfile = GetBannedFile(playerid);
if(!dini_Exists(banfile) && tick == 0)
{
new hour, minute, second, day, month, year;
gettime(hour, minute, second);
getdate(year, month, day);
dini_Create(banfile);
dini_Set(banfile,"PlayerName", Player[playerid][pName]);
dini_Set(banfile,"AdminName", "Admin Bot");
dini_Set(banfile,"Motivo", "Evasгo de Ban (Old)");
format(string, sizeof(string), "%02d/%02d аs %02d:%02d", day, month, hour, minute);
dini_Set(banfile,"Data", string);
}
return Kick(playerid);