SA-MP Forums Archive
Ajutor la comanda /laptop. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (https://sampforum.blast.hk/forumdisplay.php?fid=40)
+---- Thread: Ajutor la comanda /laptop. (/showthread.php?tid=631953)



Ajutor la comanda /laptop. - HzIoNuTZ - 07.04.2017

Salut,acum cateva zile am incercat sa fac un system de laptop,am copiat ceva dintr-un server dini, pe un server MySQL si acum nu stiu ce sa-i fac..
Las comanda aici, poate ma ajuta cineva , multumesc!
Quote:

CMD:laptop(playerid, params[])
{
if(PlayerInfo[playerid][pLaptop] == 0) return SCM(playerid, COLOR_GREY, "Nu ai un laptop!");
new cmd[256],tmp[256];
cmd = strtok(cmdtext, idx);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_SERVER, "USAGE:{FFFFFF} /laptop [on/off]");
if(strcmp("on", tmp, true, strlen(tmp)) == 0) {
if(PlayerInfo[playerid][pLaptopStatus] == 0) return SCM(playerid, COLOR_GREY, "Laptop-ul tau este deja pornit.");
SCM(playerid, COLOR_GOLD, "Laptop-ul tau a fost {32B019}pornit{F2BA38} cu succes. Foloseste /mail pentru a trimite un email!");
PlayerInfo[playerid][pLaptopStatus] = 0;
}
else if(strcmp("off", tmp, true, strlen(tmp)) == 0) {
if(PlayerInfo[playerid][pLaptopStatus] == 1) return SCM(playerid, COLOR_GREY, "Laptop-ul tau este deja inchis.");
SCM(playerid, COLOR_GOLD, "Laptop-ul tau a fost {FF0000}oprit{F2BA38} cu succes.");
PlayerInfo[playerid][pLaptopStatus] = 1;
}
return 1;
}




Re: Ajutor la comanda /laptop. - wanted2013 - 07.04.2017

Si ce nu-i bine? )


Re: Ajutor la comanda /laptop. - Banditul18 - 07.04.2017

Mai multe informatii , eventual niste erori ceva. Nu suntem clarvazatori


Re: Ajutor la comanda /laptop. - HzIoNuTZ - 08.04.2017

Mai jos
..


Re: Ajutor la comanda /laptop. - HzIoNuTZ - 08.04.2017

Ideea care e ,eu am facut sistemu de laptop si nu-mi da nici o eroare , am mai schimbat ceva la comanda si era ideea cand dai /laptop sa-l inchizi sa-l deschizi sa nu mai primesti mesaje...
Am lasat si comanda de /mail poate ajuta cu ceva.
Errorile au fost prima data acum primesti mesaje cand inchizi laptopul..
Quote:

CMD:mail(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa fii logat.");
if(IsPlayerConnected(playerid))
{
new string[128],id,mess[250],giveplayer[25],sendername[25];
if(PlayerInfo[playerid][pLaptop] == 0) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}Nu ai un laptop!");
if(PlayerInfo[playerid][pLaptopStatus] == 1) return SendClientMessage(playerid, COLOR_GREY, "Laptop-ul tau este inchis, nu poti trimite email-uri!");
if(PlayerInfo[playerid][pMuted] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti vorbi, ai mute!");
if(sscanf(params, "us[250]",id,mess)) return SCM(playerid, COLOR_WHITE, "{B98300}Foloseste:{FFFFFF} /mail <Name/Playerid> <Message>");
if (IsPlayerConnected(id))
{
new giveplayerid;
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}Nu poti sa-ti dai mesaj singur.");
if(PlayerInfo[giveplayerid][pLaptop] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "Acel player nu are un laptop.");
if(PlayerInfo[giveplayerid][pLaptopStatus] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "Laptop-ul acelui player este inchis.");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(id, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "<Mail primit> %s[%d]: %s", sendername, playerid, mess);
SendClientMessage(id, COLOR_YELLOW, string);
format(string, sizeof(string), "<Mail trimis> %s[%d]: %s", giveplayer, playerid, mess);
SendClientMessage(playerid, COLOR_YELLOW, string);
new var100[300],resulttt[300],strr[300];
format(strr, sizeof(strr),"<Mail> %s",mess);
mysql_real_escape_string(strr, resulttt);
mysql_format(SQL,var100, sizeof(var100), "INSERT INTO chat_logs (`playerid`,`text`) VALUES ('%d','%s')", PlayerInfo[playerid][pSQLID],resulttt);
mysql_tquery(SQL,var100,"","");
if(FindIP(mess))
{
format(string, sizeof(string), "{990000}Staff Info: {FF6347}%s(%d) typed %s in /w.", sendername,playerid,mess);
ABroadCast(COLOR_WHITE,string,1);
}
for(new d; d<sizeof(TLD); d++)
{
if(strfind(mess,TLD[d],true) != -1 )
{
if(strfind(mess, "www.HardZonerpg.esy.es", true) != -1 || strfind(mess, "www.HardZonerpg.esy.es", true) != -1 || strfind(mess, "www.HardZonerpg.esy.es", true) != -1) break;
new reclama[MAX_PLAYER_NAME];
GetPlayerName(playerid, reclama, sizeof(reclama));
format(string, sizeof(string), "{f03337}AdmInfo: %s a primit ban de la AdmBot, motivul: Reclama!",reclama);
SendClientMessageToAll(COLOR_LIGHTRED,string);
Kick(playerid);
return 1;
}
}
for(new adm = 0; adm<=MAX_PLAYERS;adm++)
{
if(IsPlayerConnected(adm))
{
if(PlayerInfo[adm][pAdmin] > 0 && BigEar[adm] == 1)
{
format(string, sizeof(string), "<Mail> (%d) %s catre (%d) %s: %s",playerid,sendername,id,giveplayer,mess);
SendClientMessage(adm, COLOR_YELLOW, string);
}
}
}
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}Acest jucator nu este {33FF00}Online{FFFFFF}!");
}
}
return 1;
}

CMD:laptop(playerid, params[])
{
if(PlayerInfo[playerid][pLaptop] == 0) return SCM(playerid, COLOR_GREY, "Nu ai un laptop!");
new x_nr[10];
if(sscanf(params, "s[10]",x_nr)) return SCM(playerid, COLOR_WHITE, "{B98300}Foloseste:{FFFFFF} /laptop <On-Off>");
if(strcmp(x_nr,"on",true) == 0) {
if(PlayerInfo[playerid][pLaptopStatus] == 0) return SCM(playerid, COLOR_GREY, "Laptop-ul tau este deja pornit.");
SCM(playerid, COLOR_YELLOW, "Laptop-ul tau a fost {32B019}pornit{F2BA38} cu succes. Foloseste /mail pentru a trimite un email!");
PlayerInfo[playerid][pLaptopStatus] = 0;
}
if(strcmp(x_nr,"off",true) == 0) {
if(PlayerInfo[playerid][pLaptopStatus] == 1) return SCM(playerid, COLOR_GREY, "Laptop-ul tau este deja inchis.");
SCM(playerid, COLOR_YELLOW, "Laptop-ul tau a fost {FF0000}oprit{F2BA38} cu succes.");
PlayerInfo[playerid][pLaptopStatus] = 1;
}
return 1;
}




Re: Ajutor la comanda /laptop. - Banditul18 - 08.04.2017

PHP Code:
CMD:laptop(playeridparams[])
{
    if(
PlayerInfo[playerid][pLaptop] == 0) return SCM(playeridCOLOR_GREY"Nu ai un laptop!");
    new 
cmd[256],tmp[256];
    
cmd strtok(cmdtextidx);
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp)) return SendClientMessage(playeridCOLOR_SERVER"USAGE:{FFFFFF} /laptop [on/off]");
    if(
strcmp("on"tmptruestrlen(tmp)) == 0
    {
        
PlayerInfo[playerid][pLaptopStatus] = 0;
    }
    else if(
strcmp("off"tmptruestrlen(tmp)) == 0
    {
        
PlayerInfo[playerid][pLaptopStatus] = 1;
    }
    return 
1;

Asta ar fi , din cate am inteles din ce ai spus


Re: Ajutor la comanda /laptop. - HzIoNuTZ - 08.04.2017

rezolvat,multumesc