Someone please help!!!
#1

Hey guys , can someone please convert me this commands to CMD: please ?
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);


if (strcmp(cmd, "/gang", true) ==0 )
{
new showstring[256];
format(showstring,sizeof(showstring),"Gang Create\nGang Change");
ShowPlayerDialog(playerid, DIALOGID_GANGCREATE, DIALOG_STYLE_LIST, "Gang-Display",showstring, "ACCEPT", "EXIT");
return 1;
}

if (strcmp(cmd, "/ganghelp", true) ==0 )
{
SendClientMessage(playerid, COLOR_RED, "Type in ! for gang chat.");
SendClientMessage(playerid, COLOR_RED, "COMMANDS:");
SendClientMessage(playerid, COLOR_RED, "------------");
SendClientMessage(playerid, COLOR_RED, "/gang | /ganghelp | /gangs | /invite | /kick |");
SendClientMessage(playerid, COLOR_RED, "/promote | /denote | /gstats | /credits |");
return 1;
}

if (strcmp(cmd, "/credits", true) ==0 )
{

SendClientMessage(playerid, COLOR_RED, "CREDITS:");
SendClientMessage(playerid, COLOR_RED, "---------");
SendClientMessage(playerid, COLOR_RED, "WackoX || For Fixing /gangs");
SendClientMessage(playerid, COLOR_RED, "DarCoBlue || For making dini");
SendClientMessage(playerid, COLOR_RED, "Crime Life Team || For making the half script");
SendClientMessage(playerid, COLOR_RED, "DogZone || For the idea and some script help");
return 1;
}

if(!strcmp(cmd, "/gangs", true))
{
new str5[128];
SendClientMessage(playerid, COLOR_RED, "Available Gangs:");
for(new count; count <MAX_GANGS; count++)
{
if(GangInfo[count][ID] || GangInfo[count][Name])
{
format(str5, sizeof(str5), "%s", GangInfo[count][Name]);
SendClientMessage(playerid, COLOR_RED, str5);
}
}
return 1;
}

if (strcmp(cmd, "/invite", true) ==0 )
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /invite [PartofName/ID]");
new inviteid = strval(tmp);
if(inviteid == playerid)return SendClientMessage(playerid, COLOR_RED, "You cannot invite yourself");
else if(PlayerInfo[playerid][gang_member] != 0 || PlayerInfo[playerid][gang_leader] != 0)SendClientMessage(playerid, COLOR_GRAD1, "Player is already in other gang.");
else{
for(new count = 20;count<MAX_GANGS;count++){
format(fileZ, sizeof(fileZ),"Gangs/GANG_%d.ini",count);
if(dini_Exists(fileZ)){
if(PlayerInfo[playerid][gang_leader] == GangInfo[count][ID]){
PlayerInfo[playerid][gang_member] = PlayerInfo[playerid][gang_member];
format(fileZ,sizeof(fileZ)," %s(%d) invited you to his Gang: %s(%d) ",Names(playerid),playerid,GangInfo[count][Name],GangInfo[count][ID]);
SendClientMessage(playerid, COLOR_RED, fileZ);
SendClientMessage(playerid, COLOR_RED, "You invited a Player to your Gang");}}}}
return 1;
}

if (strcmp(cmd, "/kick", true) ==0 )
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /kick [PartofName/ID]");
new kickid = strval(tmp);
if(kickid == playerid)return SendClientMessage(playerid, ROT, "You cannot kick yourself");
else if(PlayerInfo[playerid][gang_member] != PlayerInfo[playerid][gang_leader])SendClientMessage(playerid, COLOR_GRAD1, "The person must be in your gang.");
else if(PlayerInfo[playerid][gang_leader] == 0)SendClientMessage(playerid, COLOR_GRAD1, "You are not the Leader.");
else{
for(new count = 20;count<MAX_GANGS;count++){
format(fileZ, sizeof(fileZ),"Gangs/GANG_%d.ini",count);
if(dini_Exists(fileZ)){
if(PlayerInfo[playerid][gang_leader] == GangInfo[count][ID]){
PlayerInfo[playerid][gang_member] = 0;
format(fileZ,sizeof(fileZ)," %s(%d) removed you from his Gang: %s(%d) ",Names(playerid),playerid,GangInfo[count][Name],GangInfo[count][ID]);
SendClientMessage(playerid, COLOR_RED, fileZ);
SendClientMessage(playerid, COLOR_RED, "You removed a Player from your Gang.");}}}}
return 1;
}

if (strcmp(cmd, "/promote", true) ==0 )
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "Use: /promote [playerid]");
new promoteid = strval(tmp);
if(promoteid == playerid)return SendClientMessage(playerid, ROT, "You cannot promote yourself");
else if(PlayerInfo[playerid][gang_member] != PlayerInfo[playerid][gang_leader])SendClientMessage(playerid, COLOR_GRAD1, "Players must be in your gang");
else if(PlayerInfo[playerid][gang_leader] == 0)SendClientMessage(playerid, COLOR_GRAD1, "You are not the Leader.");
else{
for(new count = 20;count<MAX_GANGS;count++){
format(fileZ, sizeof(fileZ),"Gangs/GANG_%d.ini",count);
if(dini_Exists(fileZ)){
if(PlayerInfo[playerid][gang_leader] == GangInfo[count][ID]){
if(PlayerInfo[playerid][gang_rank] == 6)return SendClientMessage(playerid, COLOR_RED, "Player already got highest Rank");
PlayerInfo[playerid][gang_rank] += 1;
if(PlayerInfo[playerid][gang_rank] == 1){format(fileZ,sizeof(fileZ)," %s(%d) put you to Rank %s(%d) ",Names(playerid),playerid,GangInfo[count][Gang_Rank1],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 2){format(fileZ,sizeof(fileZ)," %s(%d) put you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank2],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 3){format(fileZ,sizeof(fileZ)," %s(%d) put you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank3],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 4){format(fileZ,sizeof(fileZ)," %s(%d) put you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank4],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 5){format(fileZ,sizeof(fileZ)," %s(%d) put you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank5],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 6){format(fileZ,sizeof(fileZ)," %s(%d) put you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank6],PlayerInfo[playerid][gang_rank]);}
SendClientMessage(playerid, COLOR_RED, fileZ);
SendClientMessage(playerid, COLOR_RED, "You have Promote the player");}}}}
return 1;
}

if (strcmp(cmd, "/denote", true) ==0 )
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /denote [playerid]");
new denoteid = strval(tmp);
if(denoteid == playerid)return SendClientMessage(playerid, ROT, "You cannot denote yourself");
else if(PlayerInfo[playerid][gang_member] != PlayerInfo[playerid][gang_leader])SendClientMessage(playerid, COLOR_GRAD1, "Player must be in your Gang.");
else if(PlayerInfo[playerid][gang_leader] == 0)SendClientMessage(playerid, COLOR_GRAD1, "You are not Leader.");
else{
for(new count = 20;count<MAX_GANGS;count++){
format(fileZ, sizeof(fileZ),"Gangs/GANG_%d.ini",count);
if(dini_Exists(fileZ)){
if(PlayerInfo[playerid][gang_leader] == GangInfo[count][ID]){
if(PlayerInfo[playerid][gang_rank] == 1)return SendClientMessage(playerid, ROT, "Player got lowest Rank.");
PlayerInfo[playerid][gang_rank] -= 1;
if(PlayerInfo[playerid][gang_rank] == 1){format(fileZ,sizeof(fileZ)," %s(%d) decreased you to Rank %s(%d) ",Names(playerid),playerid,GangInfo[count][Gang_Rank1],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 2){format(fileZ,sizeof(fileZ)," %s(%d) decreased you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank2],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 3){format(fileZ,sizeof(fileZ)," %s(%d) decreased you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank3],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 4){format(fileZ,sizeof(fileZ)," %s(%d) decreased you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank4],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 5){format(fileZ,sizeof(fileZ)," %s(%d) decreased you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank5],PlayerInfo[playerid][gang_rank]);}
if(PlayerInfo[playerid][gang_rank] == 6){format(fileZ,sizeof(fileZ)," %s(%d) decreased you to Rank %s(%d)",Names(playerid),playerid,GangInfo[count][Gang_Rank6],PlayerInfo[playerid][gang_rank]);}
SendClientMessage(playerid, ROT, fileZ);
SendClientMessage(playerid, ROT, "You decreased a Player Rank.");}}}}
return 1;
}

if (strcmp(cmd, "/gstats", true) ==0 )
{
new showstring[256];
new rstring[256];
new nmember = PlayerInfo[playerid][gang_member];
new nrank;
for(new count = 20;count<MAX_GANGS;count++)
{
format(fileZ, sizeof(fileZ),"Gangs/GANG_%d.ini",count);
if(dini_Exists(fileZ)){
if(nmember == GangInfo[count][ID]){
if(nrank == 0){rstring = "N.A";}
format(fileZ, sizeof(fileZ),"%s",GangInfo[count][Gang_Rank1]);
if(nrank == 1){rstring = fileZ;}
format(fileZ, sizeof(fileZ),"%s",GangInfo[count][Gang_Rank2]);
if(nrank == 2){rstring = fileZ;}
format(fileZ, sizeof(fileZ),"%s",GangInfo[count][Gang_Rank3]);
if(nrank == 3){rstring = fileZ;}
format(fileZ, sizeof(fileZ),"%s",GangInfo[count][Gang_Rank4]);
if(nrank == 4){rstring = fileZ;}
format(fileZ, sizeof(fileZ),"%s",GangInfo[count][Gang_Rank5]);
if(nrank == 5){rstring = fileZ;}
format(fileZ, sizeof(fileZ),"%s",GangInfo[count][Gang_Rank6]);
if(nrank == 6){rstring = fileZ;}
if(PlayerInfo[playerid][gang_leader] == GangInfo[count][ID]){rstring = "Leader";}
format(showstring,sizeof(showstring),"Gang: %s\nGang_ID: %d\nGang_Rank: %s\nGang_checkout: %d",GangInfo[count][Name],GangInfo[count][ID],rstring,GangInfo[count][Gang_Cash]);
ShowPlayerDialog(playerid, DIALOGID_STATS, DIALOG_STYLE_MSGBOX, "Stats-Display",showstring, "-OK-", "--");}}
}
return 1;
}
return 0;
}
Thanks ! )
Reply
#2

just use zcmd its better many peoples will help you to create zcmd.
Reply
#3

Yea , i now ZCMD is better but i dont now how to converte this commands to CMD ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)