scrilexxx Posted January 26, 2016 Posted January 26, 2016 Am si eu o problema la comanda /ban, cand dau /ban imi pot da si mie..
0 Daedric-Fox Posted January 26, 2016 Posted January 26, 2016 Asa e comanda + ai putea să o arați ca să știm dacă putem face cumva. ********************************** Servicii Scripting de calitate: ********************************* Future Project: ExpertGame *********************************
0 Kingsley Posted January 26, 2016 Posted January 26, 2016 Adauga linia asta in comanda: if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot ban yourself."); nu uita la inceputul comenzii sa adaugi: new giveplayerid; Retras
0 cristyifrim31O Posted January 26, 2016 Posted January 26, 2016 Arata-ne comanda /ban ca noi nu suntem cititori in stele sa vedem ce script ai tu.
0 scrilexxx Posted January 26, 2016 Author Posted January 26, 2016 (edited) http://pastebin.com/B5Yewsc4 Edited January 26, 2016 by scrilexxx
0 cristyifrim31O Posted January 26, 2016 Posted January 26, 2016 CMD:ban(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai."); if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 3) { new id,reason[128],string[200],giveplayer[30],sendername[30],Type,str[128]; if(sscanf(params, "uds[128]", id,Type,reason)) return SCM(playerid,COLOR_DS,"{B8DBFF}Syntax: /ban <Name/Playerid> <Type(1-account 2-permanent)> <reason>"); if(IsPlayerConnected(id)) { if(id != INVALID_PLAYER_ID) { GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(Type == 1) { if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!"); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este http:."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); KickEx(id); } else if(Type == 2) { if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!"); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); new giveplayerid; if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot ban yourself."); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este http://."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); Ban(id); } return 1; } } else return SendClientMessage(playerid, COLOR_DS, "{FFFFCC}Error: Player not connected."); } else return SendClientMessage(playerid, COLOR_DS, AdminOnly); } return 1; } Poftim, trebuia sa adaugi if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!");
0 scrilexxx Posted January 26, 2016 Author Posted January 26, 2016 Just now, cristyifrim31O said: CMD:ban(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai."); if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 3) { new id,reason[128],string[200],giveplayer[30],sendername[30],Type,str[128]; if(sscanf(params, "uds[128]", id,Type,reason)) return SCM(playerid,COLOR_DS,"{B8DBFF}Syntax: /ban <Name/Playerid> <Type(1-account 2-permanent)> <reason>"); if(IsPlayerConnected(id)) { if(id != INVALID_PLAYER_ID) { GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(Type == 1) { if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!"); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este http:."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); KickEx(id); } else if(Type == 2) { if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!"); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); new giveplayerid; if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot ban yourself."); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este http://."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); Ban(id); } return 1; } } else return SendClientMessage(playerid, COLOR_DS, "{FFFFCC}Error: Player not connected."); } else return SendClientMessage(playerid, COLOR_DS, AdminOnly); } return 1; } Poftim, trebuia sa adaugi if(id == playerid) return SendClientMessage(playerid, -1, "Nu te poti bana singur!"); new giveplayerid; if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot ban yourself."); Nu-i aceeasi chestie?
0 cristyifrim31O Posted January 26, 2016 Posted January 26, 2016 Just now, scrilexxx said: new giveplayerid; if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot ban yourself."); Nu-i aceeasi chestie? Tu in sscanf definesti i ca fiind jucatorul caruia ii trimiti. Nu, nu e aceeasi chestie, pentru ca e o simpla variabila, fara o functie anume.
Question
scrilexxx
Am si eu o problema la comanda /ban, cand dau /ban imi pot da si mie..
8 answers to this question
Recommended Posts