19.07.2012, 21:46
(
Последний раз редактировалось leonardo1434; 31.07.2012 в 19:52.
)
Bom, desde que o drakins criou bLines, eu tive vontade de criar uma simples base, jб que provavelmente deve ter algumas pessoas que nгo sabem usa-la.
O gamemode й simples, Contйm 606, bem Otimizado com um mini admin system e й bem direto.
Inicialmente fiz o bбsico, salvamento de kills/mortes/teamkill/skin/dinheiro/score/adminlevel.
Enfim, nгo fiz o mapa(nгo tenho paciкncia), porйm utilizei o mapa do dPlaYer_ que й bem legal para esta base.
Cуdigo:
ou
http://pastebin.com/q5aKP9GW
Caso, alguйm tenha alguma ideia para que eu possa implementar a estб base.
e tambйm й necessбrio criar a pasta "usuarios" e dentro da usuarios criar a pasta "banidos" na scriptfiles.
Crйditos:
bLines - Drakins
zcmd - Zeex
sscanf - ******
streamer - incognitos
Mapa - dPlaYer_
Pedro_miranda - Reportou alguns erros. ty mate.
O gamemode й simples, Contйm 606, bem Otimizado com um mini admin system e й bem direto.
Inicialmente fiz o bбsico, salvamento de kills/mortes/teamkill/skin/dinheiro/score/adminlevel.
Enfim, nгo fiz o mapa(nгo tenho paciкncia), porйm utilizei o mapa do dPlaYer_ que й bem legal para esta base.
Cуdigo:
pawn Код:
#include <a_samp>
#include <blines>
#include <sscanf2>
#include <zcmd>
#include <streamer>
#define NOME_SERVIDOR "Futurama"
#define usuarios "usuarios/%s.ini"
#define banidos "usuarios/banidos/%s.ini"
#define registro 1345
#define login 1346
#define dadmin 1347
#define pwned 0
#define owned 1
#define existe(%0) fexist(%0))
native gpci (playerid, serial [], len);
//news...
new
maxsex[MAX_PLAYERS] = 5,
PlayerText:tmata[MAX_PLAYERS],
PlayerText:tmortes[MAX_PLAYERS],
PlayerText:timekill[MAX_PLAYERS],
Text3D:ttext[MAX_PLAYERS],
time[MAX_PLAYERS];
main(){}
public OnGameModeInit()
{
SetGameModeText("Stairway to Heaven");
SendRconCommand("hostname "#NOME_SERVIDOR);
for(new clase = 0; clase != 299; ++clase)AddPlayerClass(clase, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
//object(ballys02_lvs)(1)
CreateDynamicObject(8392,526.20001221,-2849.69995117,28.39999962,0.00000000,0.00000000,0.00000000);
//object(ballys02_lvs)(2)
CreateDynamicObject(8392,480.60000610,-2905.89990234,28.39999962,0.00000000,0.00000000,90.00000000);
//object(ballys02_lvs)(3)
CreateDynamicObject(8392,490.60000610,-3011.89990234,28.39999962,0.00000000,0.00000000,90.00000000);
//object(ballys02_lvs)(4)
CreateDynamicObject(8392,548.90002441,-2971.30004883,28.39999962,0.00000000,0.00000000,2.00000000);
//object(ballys02_lvs)(5)
CreateDynamicObject(8392,640.00000000,-2971.80004883,28.39999962,0.00000000,0.00000000,179.99450684);
//object(ballys02_lvs)(6)
CreateDynamicObject(8392,700.79998779,-2990.89990234,28.39999962,0.00000000,0.00000000,269.99450684);
//object(ballys02_lvs)(7)
CreateDynamicObject(8392,691.20001221,-2886.30004883,28.39999962,0.00000000,0.00000000,269.98901367);
//object(ballys02_lvs)(8)
CreateDynamicObject(8392,625.40002441,-2845.39990234,28.39999962,0.00000000,0.00000000,359.98901367);
//object(casrylegrnd_lvs)(1)
CreateDynamicObject(8664,677.50000000,-3035.39990234,10.50000000,0.00000000,0.00000000,0.00000000);
//object(casrylegrnd_lvs)(2)
CreateDynamicObject(8664,622.40002441,-2895.39990234,10.50000000,0.00000000,0.00000000,180.00000000);
//object(casrylegrnd_lvs)(4)
CreateDynamicObject(8664,472.39999390,-2895.30004883,10.50000000,0.00000000,0.00000000,179.98901367);
//object(portakabin)(1)
CreateDynamicObject(1684,666.79998779,-2898.39990234,12.19999981,0.00000000,0.00000000,0.00000000);
//object(portakabin)(2)
CreateDynamicObject(1684,672.59997559,-2898.50000000,15.00000000,0.00000000,0.00000000,0.00000000);
//object(portakabin)(3)
CreateDynamicObject(1684,683.20001221,-2906.10009766,16.50000000,0.00000000,0.00000000,270.00000000);
//object(portakabin)(4)
CreateDynamicObject(1684,673.59997559,-2914.50000000,15.19999981,0.00000000,0.00000000,0.00000000);
//object(portakabin)(5)
CreateDynamicObject(1684,667.00000000,-2914.50000000,12.19999981,0.00000000,0.00000000,0.00000000);
//object(demolish1_sfxrf)(1)
CreateDynamicObject(3866,666.90002441,-2864.10009766,18.39999962,0.00000000,0.00000000,0.00000000);
//object(demolish1_sfxrf)(2)
CreateDynamicObject(3866,677.59997559,-2880.60009766,18.39999962,0.00000000,0.00000000,270.00000000);
//object(demolish4_sfxrf)(1)
CreateDynamicObject(3887,626.29998779,-2878.69995117,18.39999962,0.00000000,0.00000000,90.00000000);
//object(vgschurch02_lvs)(1)
CreateDynamicObject(8131,633.29998779,-2872.80004883,20.00000000,0.00000000,56.00000000,270.00000000);
//object(vgs_guardhouse01)(1)
CreateDynamicObject(8168,633.29998779,-2855.19995117,12.50000000,0.00000000,0.00000000,18.00000000);
//object(vgs_guardhouse01)(2)
CreateDynamicObject(8168,633.09997559,-2860.30004883,14.50000000,0.00000000,0.00000000,15.99609375);
//object(demolish1_sfxrf)(3)
CreateDynamicObject(3866,611.90002441,-2856.69995117,18.39999962,0.00000000,0.00000000,90.00000000);
//object(demolish1_sfxrf)(4)
CreateDynamicObject(3866,614.79998779,-2867.00000000,18.39999962,0.00000000,0.00000000,0.00000000);
//object(pirtshp01_lvs)(1)
CreateDynamicObject(8493,582.20001221,-2888.10009766,34.29999924,25.00000000,0.00000000,180.00000000);
//object(pirtshp01_lvs)(2)
CreateDynamicObject(8493,582.50000000,-2935.00000000,34.29999924,24.99938965,0.00000000,359.99450684);
//object(exclbrsign01_lvs)(1)
CreateDynamicObject(8620,589.40002441,-2912.39990234,33.70000076,0.00000000,0.00000000,272.00000000);
//object(excalibur03_lvs)(1)
CreateDynamicObject(8882,521.59997559,-2920.39990234,12.69999981,0.00000000,0.00000000,28.00000000);
//object(excalibur03_lvs)(2)
CreateDynamicObject(8882,538.70001221,-2873.30004883,12.69999981,0.00000000,0.00000000,207.99867249);
//object(excalibur03_lvs)(3)
CreateDynamicObject(8882,553.90002441,-2956.89990234,12.69999981,0.00000000,0.00000000,27.99865723);
//object(excalibur04_lvs)(1)
CreateDynamicObject(9078,708.09997559,-2905.19995117,15.39999962,0.00000000,0.00000000,28.00000000);
//object(des_indruin02)(1)
CreateDynamicObject(11428,662.40002441,-2948.30004883,16.50000000,0.00000000,0.00000000,0.00000000);
//object(des_indruin02)(2)
CreateDynamicObject(11428,673.50000000,-2944.30004883,16.50000000,0.00000000,0.00000000,90.00000000);
//object(des_indruin02)(3)
CreateDynamicObject(11428,676.50000000,-2963.19995117,16.50000000,0.00000000,0.00000000,330.00000000);
//object(des_indruin02)(4)
CreateDynamicObject(11428,673.70001221,-2930.89990234,16.50000000,0.00000000,0.00000000,269.99633789);
//object(des_pueblo5)(1)
CreateDynamicObject(11441,668.20001221,-2938.19995117,10.60000038,0.00000000,0.00000000,0.00000000);
//object(des_pueblo5)(2)
CreateDynamicObject(11441,673.20001221,-2935.39990234,10.60000038,0.00000000,0.00000000,280.00000000);
//object(des_indruin02)(7)
CreateDynamicObject(11428,673.50000000,-2944.29980469,16.50000000,0.00000000,0.00000000,90.00000000);
//object(des_pueblo5)(3)
CreateDynamicObject(11441,678.09997559,-2937.39990234,10.60000038,0.00000000,0.00000000,3.99755859);
//object(des_pueblo5)(4)
CreateDynamicObject(11441,683.20001221,-2934.60009766,10.60000038,0.00000000,0.00000000,273.99353027);
//object(des_pueblo5)(5)
CreateDynamicObject(11441,666.40002441,-2942.89990234,10.60000038,0.00000000,0.00000000,269.99353027);
//object(des_pueblo4)(1)
CreateDynamicObject(11443,654.50000000,-2933.89990234,10.60000038,0.00000000,0.00000000,0.00000000);
//object(des_pueblo4)(2)
CreateDynamicObject(11443,653.20001221,-2946.50000000,10.60000038,0.00000000,0.00000000,90.00000000);
//object(des_pueblo4)(3)
CreateDynamicObject(11443,648.50000000,-2956.69995117,10.60000038,0.00000000,0.00000000,0.00000000);
//object(des_pueblo06)(1)
CreateDynamicObject(11445,644.50000000,-2953.00000000,10.60000038,0.00000000,0.00000000,0.00000000);
//object(des_pueblo06)(2)
CreateDynamicObject(11445,641.59997559,-2943.80004883,10.60000038,0.00000000,0.00000000,90.00000000);
//object(des_pueblo08)(1)
CreateDynamicObject(11447,642.90002441,-2935.80004883,10.60000038,0.00000000,0.00000000,0.00000000);
//object(des_pueblo08)(2)
CreateDynamicObject(11447,645.50000000,-2925.80004883,10.60000038,0.00000000,0.00000000,270.00000000);
//object(des_pueblo10)(1)
CreateDynamicObject(11458,653.50000000,-2918.39990234,10.60000038,0.00000000,0.00000000,0.00000000);
//object(des_pueblo08)(3)
CreateDynamicObject(11447,663.70001221,-2922.39990234,10.60000038,0.00000000,0.00000000,0.00000000);
//object(carter-balcony)(1)
CreateDynamicObject(14447,645.40002441,-2890.60009766,15.39999962,0.00000000,0.00000000,358.00000000);
//object(des_gunbldg01)(1)
CreateDynamicObject(16770,633.50000000,-2959.50000000,12.19999981,0.00000000,0.00000000,270.00000000);
//object(lasbrid1_las)(2)
CreateDynamicObject(4882,620.59997559,-2948.19995117,32.20000076,0.00000000,0.00000000,0.00000000);
//object(lasbrid1_las)(3)
CreateDynamicObject(4882,629.00000000,-2921.69995117,32.20000076,0.00000000,0.00000000,270.00000000);
//object(lasbrid1_las)(4)
CreateDynamicObject(4882,658.59997559,-2929.00000000,32.20000076,0.00000000,0.00000000,4.00000000);
//object(lasbrid1_las)(6)
CreateDynamicObject(4882,665.29998779,-2898.00000000,32.20000076,0.00000000,0.00000000,273.99902344);
//object(vgehshade01_lvs)(2)
CreateDynamicObject(8838,618.00000000,-2904.60009766,26.20000076,0.00000000,0.00000000,270.00000000);
//object(vgehshade01_lvs)(3)
CreateDynamicObject(8838,640.29998779,-2927.10009766,26.20000076,0.00000000,0.00000000,270.00000000);
//object(vgehshade01_lvs)(4)
CreateDynamicObject(8838,677.20001221,-2902.39990234,26.20000076,0.00000000,0.00000000,270.00000000);
//object(vgehshade01_lvs)(5)
CreateDynamicObject(8838,652.79998779,-2865.50000000,23.70000076,0.00000000,352.00000000,270.00000000);
//object(vgehshade01_lvs)(6)
CreateDynamicObject(8838,601.09997559,-2973.60009766,26.10000038,0.00000000,0.00000000,270.00000000);
//object(vgehshade01_lvs)(7)
CreateDynamicObject(8838,614.09997559,-2955.19995117,21.89999962,0.00000000,346.00000000,180.00000000);
//object(portakabin)(6)
CreateDynamicObject(1684,635.29998779,-2955.19995117,17.60000038,0.00000000,0.00000000,0.00000000);
//object(portakabin)(7)
CreateDynamicObject(1684,638.20001221,-2947.89990234,16.39999962,0.00000000,0.00000000,90.00000000);
//object(portakabin)(8)
CreateDynamicObject(1684,630.40002441,-2945.00000000,15.39999962,0.00000000,0.00000000,180.00000000);
//object(portakabin)(9)
CreateDynamicObject(1684,619.79998779,-2945.00000000,13.89999962,0.00000000,0.00000000,179.99450684);
//object(portakabin)(10)
CreateDynamicObject(1684,609.59997559,-2945.30004883,12.39999962,0.00000000,0.00000000,179.99450684);
//object(portakabin)(11)
CreateDynamicObject(1684,606.59997559,-2952.39990234,12.39999962,0.00000000,0.00000000,269.99450684);
//object(des_gunbldg01)(2)
CreateDynamicObject(16770,617.00000000,-2959.39990234,12.19999981,0.00000000,0.00000000,270.00000000);
//object(des_gunbldg01)(3)
CreateDynamicObject(16770,624.29998779,-2952.00000000,12.19999981,0.00000000,0.00000000,90.00000000);
//object(tepee_room_)(2)
CreateDynamicObject(3243,604.70001221,-2893.00000000,10.60000038,0.00000000,0.00000000,0.00000000);
//object(tepee_room_)(3)
CreateDynamicObject(3243,604.70001221,-2899.60009766,10.60000038,0.00000000,0.00000000,0.00000000);
//object(tepee_room_)(4)
CreateDynamicObject(3243,605.29998779,-2939.80004883,10.60000038,0.00000000,0.00000000,0.00000000);
//object(tepee_room_)(5)
CreateDynamicObject(3243,604.90002441,-2908.60009766,10.60000038,0.00000000,0.00000000,0.00000000);
//object(tepee_room_)(6)
CreateDynamicObject(3243,605.09997559,-2916.39990234,10.60000038,0.00000000,0.00000000,0.00000000);
//object(tepee_room_)(7)
CreateDynamicObject(3243,605.09997559,-2925.10009766,10.60000038,0.00000000,0.00000000,0.00000000);
//object(tepee_room_)(8)
CreateDynamicObject(3243,605.19921875,-2932.39941406,10.60000038,0.00000000,0.00000000,0.00000000);
//object(sfse_roadblock5)(1)
CreateDynamicObject(4526,623.40002441,-2932.19995117,12.60000038,0.00000000,0.00000000,0.00000000);
//object(sfse_roadblock5)(2)
CreateDynamicObject(4526,628.00000000,-2905.10009766,12.60000038,0.00000000,0.00000000,54.00000000);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
static arq[128],serial[70];
gpci(playerid,serial,sizeof(serial));
format(arq,128,banidos,serial);
if(existe(arq)
{
static l_2[128];
File_Open(arq);
format(l_2,128,"Vocк estб banido,O Administrador: %s o baniu vocк por %s ",File_Get(3),File_Get(4));
SendClientMessage(playerid,-1,l_2);
Kick(playerid);
}
if(existe(contas(playerid)) {
ShowPlayerDialog(playerid, login, DIALOG_STYLE_PASSWORD,"Login", "Conta jб registrada,por favor, digitar sua senha.", "Confirmar" , "Cancelar");
}
else {
ShowPlayerDialog(playerid, registro, DIALOG_STYLE_PASSWORD,"Registro", "Conta nгo registrada, Digita uma senha.", "Confirma", "Cancelar");
}
tmata[playerid] = CreatePlayerTextDraw(playerid,497.000000, 99.000000, "Mata:");
PlayerTextDrawBackgroundColor(playerid,tmata[playerid], 255);
PlayerTextDrawFont(playerid,tmata[playerid], 1);
PlayerTextDrawLetterSize(playerid,tmata[playerid], 0.360000, 0.899999);
PlayerTextDrawColor(playerid,tmata[playerid], -1);
PlayerTextDrawSetOutline(playerid,tmata[playerid], 1);
PlayerTextDrawSetProportional(playerid,tmata[playerid], 1);
tmortes[playerid] = CreatePlayerTextDraw(playerid,497.000000, 106.000000, "Mortes:");
PlayerTextDrawBackgroundColor(playerid,tmortes[playerid], 255);
PlayerTextDrawFont(playerid,tmortes[playerid], 1);
PlayerTextDrawLetterSize(playerid,tmortes[playerid], 0.360000, 0.899999);
PlayerTextDrawColor(playerid,tmortes[playerid], -1);
PlayerTextDrawSetOutline(playerid,tmortes[playerid], 1);
PlayerTextDrawSetProportional(playerid,tmortes[playerid], 1);
timekill[playerid] = CreatePlayerTextDraw(playerid,497.000000, 113.000000, "Time mata:");
PlayerTextDrawBackgroundColor(playerid,timekill[playerid], 255);
PlayerTextDrawFont(playerid,timekill[playerid], 1);
PlayerTextDrawLetterSize(playerid,timekill[playerid], 0.360000, 0.899999);
PlayerTextDrawColor(playerid,timekill[playerid], -1);
PlayerTextDrawSetOutline(playerid,timekill[playerid], 1);
PlayerTextDrawSetProportional(playerid,timekill[playerid], 1);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
salvar(playerid);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
if(classid >= 0 && classid <= 149) {
GameTextForPlayer(playerid,"~g~time dos PWNED",3000,5);
time[playerid] = pwned;
}
else if(classid > 149 && classid <= 299) {
GameTextForPlayer(playerid,"~b~time dos OWNED",3000,5);
time[playerid] = owned;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
PlayerTextDrawShow(playerid,tmata[playerid]);
PlayerTextDrawShow(playerid,tmortes[playerid]);
PlayerTextDrawShow(playerid,timekill[playerid]);
if(time[playerid] == pwned)ttext[playerid] = Create3DTextLabel("Time Pwned", 0xFF0000FF, 30.0, 40.0, 50.0, 20.0, 30),SetPlayerPos(playerid,582.3112,-2904.7744,31.4812+2);
else if(time[playerid] == owned)ttext[playerid] = Create3DTextLabel("Time Owned", 0xFF0000FF, 30.0, 40.0, 50.0, 20.0, 30),SetPlayerPos(playerid,678.6399,-2918.4465,28.7306+2);
GivePlayerWeapon(playerid,26,500);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,29,500);
GivePlayerWeapon(playerid,34,500);
SetPlayerArmour(playerid,100);
if(GetPVarInt(playerid,"logado") == 1)
{
File_Open(contas(playerid));
SetPlayerSkin(playerid,File_GetInt(4));
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(playerid != INVALID_PLAYER_ID) {
SetPVarInt(playerid,"mortes",GetPVarInt(playerid,"mortes")+1);
}
if(killerid != INVALID_PLAYER_ID) {
if(time[killerid] != time[playerid]) {
GivePlayerMoney(playerid,2000);
SetPVarInt(killerid,"mata",GetPVarInt(killerid,"mata")+1);
SetPVarInt(killerid,"score",GetPVarInt(killerid,"score")+1);
}
else if(time[killerid] == time[playerid]) {
SetPVarInt(killerid,"timemata",GetPVarInt(playerid,"timemata")+1);
GivePlayerMoney(killerid,-5000); // rsrs й pouco eu sei xD, agora que vem a parte legal.
SetPlayerHealth(killerid,GetPVarFloat(killerid,"tk"));
}
CallLocalFunction("update", "i",killerid);
}
CallLocalFunction("update", "i",playerid);
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
SetPVarFloat(playerid,"tk",amount); // a cada tiro a var, irб auterar o seu valor.
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == registro)
{
if(!response){SendClientMessage(playerid,-1,"Vocк foi kickado por nгo se registrar.");return Kick(playerid);}
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,registro, DIALOG_STYLE_PASSWORD,"Registro", "Digite sua senha.", "Confirmar","Cancelar");
File_Open(contas(playerid));
File_Set(0,inputtext); // senha
File_SetInt(1, 0);// level admin
File_SetInt(2, 0);// dinheiro
File_SetInt(3, 0);// score
File_SetInt(4, 0);// skin
File_SetInt(5, 0);// mortes
File_SetInt(6, 0);// mata
File_SetInt(7, 0);// timemata
File_Save();
GivePlayerMoney(playerid,30000);
carregar(playerid);
CallLocalFunction("update", "i",playerid); // atualizamos a textdraw.
SetPVarInt(playerid,"logado",1);
}
if(dialogid == login) {
if(!response){SendClientMessage(playerid,-1,"Vocк foi kickado por nгo logar."); return Kick(playerid);}
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,login, DIALOG_STYLE_PASSWORD,"Registro", "Digite sua senha.", "Confirmar","Cancelar");
File_Open(contas(playerid));
if(strcmp(inputtext,File_Get(0),false)) {
if(maxsex[playerid] < 1){SendClientMessage(playerid,-1,"Vocк foi kickado por ultrapassar o limite de tentivas"); return Kick(playerid);}
maxsex[playerid]--;
static l_st[50];
format(l_st,50,"Senha errada, vocк tem mais %i tentativas.",maxsex);
ShowPlayerDialog(playerid,login, DIALOG_STYLE_PASSWORD,"Login", l_st, "Confirmar","Cancelar");
}
else
{
carregar(playerid);
File_Open(contas(playerid));
GivePlayerMoney(playerid,File_GetInt(2));
SetPlayerScore(playerid,File_GetInt(3));
SetPlayerSkin(playerid,File_GetInt(4));
CallLocalFunction("update", "i",playerid); // atualizamos a textdraw.
SetPVarInt(playerid,"logado",1);
SendClientMessage(playerid,-1,"Vocк estб logado!");
}
}
return 1;
}
CMD:daradmin(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 3 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,level,l_st[100];
if(sscanf(params,"ui",id,level))return SendClientMessage(playerid,-1,"/daradmin [ID] [LEVEL]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
if(level < 0 || level > 3) return SendClientMessage(playerid,-1,"Level entre 0 - 3");
format(l_st,100,"Administrador: %s promoveu %s para administrador level %i",nm(playerid),nm(id),level);
SendClientMessageToAll(-1,l_st);
SetPVarInt(id,"admlevel",level);
salvar(id);
carregar(id);
return 1;
}
CMD:ir(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,Float:X,Float:Y,Float:Z;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"/ir [ID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
GetPlayerPos(id,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
return 1;
}
CMD:trazer(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,Float:X,Float:Y,Float:Z;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"/trazer [ID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(id,X,Y,Z);
return 1;
}
CMD:removerarma(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,armaid,l_2[70];
if(sscanf(params,"ui",id,armaid)) return SendClientMessage(playerid,-1,"/removerarma [ID] [ARMAID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
if(armaid < 0 || armaid > 46) return SendClientMessage(playerid,-1,"Id da arma entre 0 - 46");
format(l_2,70,"Administrador: %s removeu uma arma sua",nm(playerid));
SendClientMessage(id,-1,l_2);
removerarma(id,armaid);
return 1;
}
CMD:dararma(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,armaid,mun,l_2[70];
if(sscanf(params,"uii",id,armaid,mun)) return SendClientMessage(playerid,-1,"/dararma [ID] [ARMAID] [MUNIЗГO]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
if(armaid < 0 || armaid > 46) return SendClientMessage(playerid,-1,"Id da arma entre 0 - 46");
GivePlayerWeapon(id,armaid,mun);
format(l_2,70,"Administrador: %s deu uma arma para vocк!",nm(playerid));
SendClientMessage(id,-1,l_2);
return 1;
}
CMD:interior(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,interior,l_2[84];
if(sscanf(params,"ui",id,interior)) return SendClientMessage(playerid,-1,"/interior [ID] [interiorid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
format(l_2,84,"Administrador: %s setou seu interior para %i",nm(playerid),interior);
SendClientMessage(playerid,-1,l_2);
SetPlayerInterior(id,interior);
return 1;
}
CMD:admins(playerid,params[])
{
new l_2[128],admins;
for(new i = 0; i != MAX_PLAYERS;++i) {
if(GetPVarInt(i,"admlevel") > 0)
{
admins++;
format(l_2,128,"Nome: %s - Level %i\n",nm(i),GetPVarInt(i,"admlevel"));
}
}
if(admins > 0) return ShowPlayerDialog(playerid, 235, DIALOG_STYLE_MSGBOX,"Admins Online",l_2, "Fechar", "");
else return SendClientMessage(playerid,-1,"Sem administradores online");
}
CMD:a(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static string,string2[128];
if(sscanf(params,"s[128]",string)) return SendClientMessage(playerid,-1,"/a [texto] ");
for(new i=0;i<MAX_PLAYERS;i++) {
if(GetPVarInt(i,"admlevel") > 0) {
format(string2,sizeof(string2),"ADMCHAT: %s: %s",nm(i),string);
SendClientMessage(i,-1,string2);
}
}
return 1;
}
CMD:tapa(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static l_2[84],id,Float:X,Float:Y,Float:Z;
if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"/tapa [ID] ");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
GetPlayerPos(id,X,Y,Z);
SetPlayerPos(id,X,Y,Z+11.5);
format(l_2,84,"Adminitrador: %s deu uma tapa em %s",nm(playerid),nm(id));
SendClientMessageToAll(-1,l_2);
return 1;
}
CMD:kickall(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 3 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static l_3,l_2[128];
if(sscanf(params,"s[128]",l_3)) return SendClientMessage(playerid,-1,"/kickall [MOTIVO]");
format(l_2,128,"%s",l_3);
for(new i = 0; i != MAX_PLAYERS; ++i) {
if(i == playerid) return 0;
else{
SendClientMessage(i,-1,l_2);
Kick(i);}
}
return 1;
}
CMD:kick(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static l_2[128],id,motivo[90];
if(sscanf(params,"us[90]",id,motivo)) return SendClientMessage(playerid,-1,"/kick [ID] [MOTIVO]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Jogador nгo conectado");
format(l_2,128,"Administrador: %s Kickou vocк por : %s",nm(playerid),nm(id),motivo);
SendClientMessage(id,-1,l_2);
Kick(id);
return 1;
}
CMD:banir(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static arq[90],serial[80],id,l_2[128],motivo[128],ip[16],dia,mes,ano,hora,minuto,segundo,dd[70];
if(sscanf(params,"us[128]",id,motivo)) return SendClientMessage(playerid,-1,"/banir [ID] [MOTIVO]");
gpci(id,serial,sizeof(serial));
GetPlayerIp(id,ip,sizeof(ip));
gettime(hora,minuto,segundo);
getdate(dia,mes,ano);
format(dd,70,"Dia: %i Mкs: %i Ano: %i - Hora: %i Minutos: %i Segundos : %i",dia,mes,ano,hora,minuto,segundo);
format(arq,90,banidos,serial);
File_Open(arq);
File_Set(0,serial);// serial
File_Set(1,ip);//ip
File_Set(2,dd);//data
File_Set(3,nm(playerid)); // nome do admin
File_Set(4,motivo);// motivo
File_Set(5,nm(id));// nome do banido
format(l_2,128,"Administrador: %s baniu vocк por : %s",nm(playerid),motivo);
SendClientMessage(id,-1,l_2);
format(l_2,128,"Administrador: %s baniu %s por: %s",nm(playerid),nm(id),motivo);
SendClientMessageToAll(-1,l_2);
Kick(id);
return 1;
}
CMD:calar(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,motivo[128],l_2[128];
if(sscanf(params,"us[128]",id,motivo)) return SendClientMessage(playerid,-1,"/calar [ID] [MOTIVO]");
format(l_2,128,"Adminitrador: %s calou %s por %s",nm(playerid),nm(id),motivo);
SendClientMessageToAll(-1,l_2);
SetPVarInt(id,"calado",1);
return 1;
}
CMD:fala(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static id,l_2[128];
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"/fala [ID]");
format(l_2,128,"Adminitrador: %s liberou %s para falar.",nm(playerid),nm(id));
SendClientMessageToAll(-1,l_2);
SetPVarInt(id,"calado",0);
return 1;
}
CMD:skin(playerid,params[])
{
static id;
if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"/skin [ID]");
if(id < 0 || id > 299) return SendClientMessage(playerid,-1,"ID entre 0 ~ 299");
SetPlayerSkin(playerid,id);
File_Open(contas(playerid));
File_SetInt(4,id);
return 1;
}
CMD:acmd(playerid,params[])
{
if(GetPVarInt(playerid,"admlevel") == 0 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Sem poderes suficientes");
static l_2[207];
format(l_2,sizeof(l_2),"Comandos para Admin level 1:\n/calar\n/fala\n/interior\n/trazer\n/ir\n/a - admin chat\n\n Comandos para Admin level 2:\n/kick\n/tapa\n/dararma\n/removerarma\n\nComandos para Admin level 3:\n/banir\n/kickall");
ShowPlayerDialog(playerid, 235, DIALOG_STYLE_MSGBOX,"Admins Online",l_2, "Fechar", "");
return 1;
}
CMD:comandos(playerid,params[])
{
SendClientMessage(playerid,-1,"/admins\n/skin");
return 1;
}
public OnPlayerText(playerid, text[])
{
if(GetPVarInt(playerid,"calado") == 1) {
SendClientMessage(playerid, -1, "Vocк estб calado !");
return 0;
}
return 1;
}
forward update(p);
public update(p)
{
static l_2[14];
format(l_2, sizeof(l_2),"Mata: %i",GetPVarInt(p,"mata"));
PlayerTextDrawSetString(p,tmata[p], l_2);
format(l_2, sizeof(l_2),"Mortes: %i",GetPVarInt(p,"mortes"));
PlayerTextDrawSetString(p,tmortes[p], l_2);
format(l_2, sizeof(l_2),"Time Mata: %i",GetPVarInt(p,"timemata"));
PlayerTextDrawSetString(p,timekill[p], l_2);
SetPlayerScore(p,GetPVarInt(p,"score"));
}
// para carregar o arquivo.
stock carregar(p)
{
File_Open(contas(p));
SetPVarInt(p,"admlevel",File_GetInt(1));
SetPVarInt(p,"mortes",File_GetInt(5));
SetPVarInt(p,"mata",File_GetInt(6));
SetPVarInt(p,"timemata",File_GetInt(7));
}
stock salvar(p)
{
File_Open(contas(p));
File_SetInt(1, GetPVarInt(p,"admlevel"));
File_SetInt(2, GetPlayerMoney(p));
File_SetInt(3, GetPlayerScore(p));
File_SetInt(5, GetPVarInt(p,"mortes"));
File_SetInt(6, GetPVarInt(p,"mata"));
File_SetInt(7, GetPVarInt(p,"timemata"));
File_Save();
}
stock removerarma(p,armaid)
{
new l_arma[12],l_muni[12],l_arma2,l_muni2;
for(new Tslots = 0; Tslots != 12;Tslots++ ){GetPlayerWeaponData(p,Tslots,l_arma2,l_muni2);if(l_arma2!= armaid)GetPlayerWeaponData(p,Tslots,l_arma[Tslots],l_muni[Tslots]);}
ResetPlayerWeapons(p);
for(new Tslots = 0;Tslots != 12;Tslots++)GivePlayerWeapon(p,l_arma[Tslots],l_muni[Tslots]);
}
stock nm(p){static nome[25];GetPlayerName(p,nome,25);return nome;}
stock contas(p){static arq[50];format(arq,50,usuarios,nm(p));return arq;}
http://pastebin.com/q5aKP9GW
Caso, alguйm tenha alguma ideia para que eu possa implementar a estб base.
e tambйm й necessбrio criar a pasta "usuarios" e dentro da usuarios criar a pasta "banidos" na scriptfiles.
Crйditos:
bLines - Drakins
zcmd - Zeex
sscanf - ******
streamer - incognitos
Mapa - dPlaYer_
Pedro_miranda - Reportou alguns erros. ty mate.