02.09.2015, 08:55
Hi all, i want to chabge this comand on Dialog but i don't know how
Command:
And now i don't know how to make it, give rep
Command:
PHP код:
CMD:fwarn(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu esti logat!");
new id,sendername[30],giveplayer[30],string[100];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLeader] >= 1)
{
if(sscanf(params, "u", id)) return SCM(playerid,COLOR_WHITE,"Tasteaza: /fwarn <Name/Playerid>");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(id, giveplayer, sizeof(giveplayer));
if(PlayerInfo[id][pLeader] >= 1) return SCM(playerid,COLOR_WHITE,"{FFB870}The player is leader.");
if(PlayerInfo[id][pMember] > 0 && (PlayerInfo[id][pMember] == PlayerInfo[playerid][pLeader]))
{
if(IsPlayerConnected(id))
{
if(id != INVALID_PLAYER_ID)
{
PlayerInfo[id][pFACWarns] += 1;
format(string, sizeof(string), "You gave to %s a faction warn.", giveplayer);
SCM(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Leader %s gave you a faction warn.", sendername);
SCM(id, COLOR_LIGHTBLUE, string);
new wakaname[25],str[250];
GetPlayerName(id,wakaname,sizeof(wakaname));
format(str,sizeof(str),"UPDATE users SET `FWarn`='%d' WHERE `name`='%s'",PlayerInfo[id][pFACWarns],wakaname);
mysql_query(SQL,str);
Factionlog(PlayerInfo[id][pMember],PlayerInfo[id][pSQLID],"Received Faction Warn.");
if(PlayerInfo[id][pFACWarns] >= 3)
{
gTeam[id] = 3;
PlayerInfo[id][pTeam] = 3;
PlayerInfo[id][pMember] = 0;
PlayerInfo[id][pLeader] = 0;
PlayerInfo[id][pRank] = 0;
PlayerInfo[id][pChar] = 0;
PlayerInfo[id][pFpunish] = 10;
PlayerInfo[id][pFACWarns] = 0;
OnDuty[id] = 0;
SetPlayerArmourEx(id, 0);
format(string, sizeof(string), "Liderul %s te-a scos din factiune (3/3 avertismente) cu 10/20 FPunish!", sendername);
SCM(id, COLOR_LIGHTBLUE, string);
SetPlayerSkin(id,PlayerInfo[id][pModel]);
SpawnPlayer(id);
format(str,sizeof(str),"UPDATE users SET `Team`='3',`Member`='0',`Leader`='0',`Rank`='0',`CChar`='0',`FPunish`='10',`FWarn`='0' WHERE `name`='%s'",wakaname);
mysql_query(SQL,str);
}
return 1;
}
}
else return SCM(playerid, COLOR_WHITE, "Jucatorul nu este conectat.");
}
else return SCM(playerid, COLOR_WHITE, "Player isn't in your faction.");
}
else return SCM(playerid, 0xFFB870FF, "Only leaders can use this command.");
}
return 1;
}