02.12.2015, 21:09
pawn Код:
stock GetCrime(type)
{
new string[64];
printf("Type %d", type);
switch(type)
{
case 0: string = "Arson";
case 1: string = "Arson (Attempted)";
case 2: string = "Assault";
case 3: string = "Battery";
case 4: string = "Bribery";
case 5: string = "Burglary";
case 6: string = "Burglary (Attempted)";
case 7: string = "Conspiracy";
case 8: string = "Disorderly Conduct";
case 9: string = "Disturbing the Peace";
case 10: string = "Domestic Violence";
case 11: string = "Drug Cultivation or Manufacturing";
case 12: string = "Drug Possesion";
case 13: string = "Drug Trafficking or Distribution";
case 14: string = "Drunk Driving";
case 15: string = "Embezzlement";
case 16: string = "Extortion";
case 17: string = "Fraud";
case 18: string = "Grand Theft Auto";
case 19: string = "Grand Theft Auto (Attempted)";
case 20: string = "Harassment";
case 21: string = "Hate Crime";
case 22: string = "Kidnapping";
case 23: string = "Kidnapping (Attempted)";
case 24: string = "Money Laundering";
case 25: string = "Murder";
case 26: string = "Murder (Attempted)";
case 27: string = "Murder (Public Official/Police Officer)";
case 28: string = "Prostitution";
case 29: string = "Public Intoxication";
case 30: string = "Rape";
case 31: string = "Rape (Attempted)";
case 32: string = "Robbery";
case 33: string = "Robbery (Attempted)";
case 34: string = "Sexual Assault";
case 35: string = "Stalking";
case 36: string = "Tax Evasion";
case 37: string = "Theft";
case 38: string = "Theft (Attempted)";
case 39: string = "Vandalism";
}
printf("string %s", string);
return string;
}
pawn Код:
format(string1, sizeof(string1),"Arson\nArson (Attempted)\nAssault\nBattery\nBribery\nBurglary\nBurglary (Attempted)\nDisturbing the Peace\nDomestic Violence\nDrug Cultivation or Manufacturing\nDrug Possesion\nDrug Trafficking or Distribution\n");
strcat(string, string1);
format(string2, sizeof(string2),"Drunk Driving\nEmbezzlement\nExtortion\nFraud\nGrand Theft Auto\nGrand Theft Auto (Attempted)\nHarassment\nHate Crime\nKidnapping\nKidnapping (Attempted)\nMoney Laundering\n");
strcat(string, string2);
format(string3, sizeof(string3),"Murder\nMurder (Attempted)\nMurder (Public Official/Police Officer)\nProstitution\nPublic Intoxication\nRape\nRape (Attempted)\nRobbery\nRobbery (Attempted)\nStalking\nTax Evasion\nTheft\nTheft (Attempted)\nVandalism");
strcat(string, string3);
ShowPlayerDialog(playerid, DIALOG_ADDRCD, DIALOG_STYLE_LIST, "Please select a crime to add to records", string, "Search", "Cancel");
i.e GetCrime(type) 25 = Murder...
the result when the listitem is used as the type is: Kidnapping (Attempted)....which is extremely confusing.
Could anyone shed some light?

