23.08.2015, 00:46
When I press the "Get" button, nothing happens:
Dialogs are defined well, they are not messed up with eachother.
PHP код:
CMD:contracts(playerid, params[])
{
new string[128],contractsbox[1024];
if(GetPlayerFaction(playerid) == 7)
{
AllHits[playerid] = -1;
foreach(Player, i)
{
if(IsPlayerConnected(i) && GetPVarInt(i,"Assasinate") == 1)
{
format(string, sizeof string, ""HITMANSV"Hit on {FFFFFF}%s "HITMANSV"({FFFFFF}%i"HITMANSV") for {FFFFFF}$%d"HITMANSV".", pName(i), i, GetPVarInt(i,"AssasinateFor"));
strcat(contractsbox, string);
AllHits[playerid]++;
Count[playerid][AllHits[playerid]] = i;
}
}
if(AllHits[playerid] == -1)
{
SendClientMessage(playerid, -1, "No hits placed at this time!");
}
else ShowPlayerDialog(playerid,DIALOGHITS-2,DIALOG_STYLE_MSGBOX,""HITMANSV"Current Hits:",contractsbox,"Get","Cancel");
}
else
{
SendClientMessage(playerid,-1,"You are not a Hitman.");
}
return 1;
}
PHP код:
if(dialogid == DIALOGHITS-2)
{
if(!response) return SCM(playerid,COLOR_DGREY,"You closed.");
if(ContractLuat[playerid] != -1) return SCM(playerid, COLOR_DGREY, "You already have a hit.");
for(new i = 0; i <= AllHits[playerid]; i++)
{
if(listitem == i)
{
if(GetPVarInt(playerid, "Contracte") == 5) return SCM(playerid, COLOR_DGREY, "You are allowed to get maximum 5 contracts in one played hour.");
SetPVarInt(Count[playerid][i], "Assasinate", 2);
ContractLuat[playerid] = Count[playerid][i];
new string1[MAX_PLAYER_NAME+32], string2[128],string3[1024];
format(string1, sizeof(string1), ""HITMANSV"Details about: {FFFFFF}%s"HITMANSV":", pName(ContractLuat[playerid]));
format(string2, sizeof(string2), ""HITMANSV"%s {FFFFFF}["HITMANSV"%d{FFFFFF}]",pName(ContractLuat[playerid]), ContractLuat[playerid]);
strcat(string3,string2);
format(string2, sizeof(string2), "\n\n"HITMANSV"Faction: %s\n"HITMANSV"Rank: %d",GetPlayerFactionName(ContractLuat[playerid]), GetPVarInt(ContractLuat[playerid], "Rank"));
strcat(string3,string2);
format(string2, sizeof(string2), "\n\n"HITMANSV"Score: %d\n"HITMANSV"Job: %s",GetPVarInt(ContractLuat[playerid],"Score"),GetPlayerJobName(ContractLuat[playerid]));
strcat(string3,string2);
format(string2, sizeof(string2), "\n\n"HITMANSV"House: "REDSV"%s\n"HITMANSV"Business: "REDSV"%s",GetPlayerHouse(ContractLuat[playerid]), GetPlayerBiz(ContractLuat[playerid]));
strcat(string3,string2);
format(string2, sizeof(string2), "\n\n"HITMANSV"Skin: "REDSV"%d\n"HITMANSV"Hair: "REDSV"%s",GetPlayerSkin(ContractLuat[playerid]), GetPlayerHair(ContractLuat[playerid]));
strcat(string3,string2);
ShowPlayerDialog(playerid, DIALOGHITS-1, DIALOG_STYLE_MSGBOX, string1, string3, "OK", "");
}
}
}