25.08.2010, 12:04
So im using larp gm and i want to add dialog when i type /stats to give it on dialog
because without dialog is verry stupid can anyone help me?
because without dialog is verry stupid can anyone help me?
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/stats", true))
{
new string[128];
format(string, sizeof(string), "Kills: %d\nDeaths: %d", stat1, stat2);
ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "Stats", string, "Close", "Close");
return 1;
}
return 0;
}
Depends what stats you need?
I guess a dialog can read all of your codes and let you read them. I'm not that experienced with dialogs though. |
//-------------------------------[Stats]-------------------------------------------------------------------------- if (strcmp(cmd, "/stats", true) == 0) { if(IsPlayerConnected(playerid)) { if (gPlayerLogged[playerid] != 0) { ShowStats(playerid,playerid); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stats",d,m,y,h,mi,s,sendername); CommandLog(string); } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in!"); return 1; } } return 1; }
format(coordsstring, sizeof(coordsstring),"|_________________________________________________| %s (%d) |_________________________________________________|",name, targetid); SendClientMessage(playerid, COLOR_GREEN,coordsstring); format(coordsstring, sizeof(coordsstring), "| Level: %d | Sex: %s | Age: %d | Cash: $%d | Bank: $%d | Ph: %d | Regular Rank: %s |", level,atext,age,cash,account,pnumber,drank); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| Total Playing Hours: %d | Total Playing Mins: %d | Total Playing Secs: %d | BiggestFish: %d | TimesArrested: %d |",(ptime / 3600), (ptime / 60), ptime,bigfish,arrests); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| Respect: %d/%d | Deaths: %d | Drugs: %d | Materials: %d | Team: %s | Rank: %s | Kills: %d | Warnings: %d |",exp,expamount,Deaths,drugs,mats,ttext,rtext, Kills,warned); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| Swat Rank: %s | Tactical Rank: %s | Forces Rank: %s | DD Manager: %d | LottoNr: %d | Crimes: %d |",swatr,tacticalr,specialfr,drights,lotto,crimes); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| Fighting: %s | Tester Rank: %d | ColtSkill: %d | Silenced Skill: %d | Deagle Skill: %d | Shotgun Skill: %d |",fight, tester, Colt,Silenced,Deagle, Shotgun); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| SawnSkill: %d | Combat Skill: %d | Uzi Skill: %d | SMG Skill: %d | M4 Skill: %d | AK-47 Skill: %d |", Sawn,Combat,Uzi, Smg, M4, Ak47); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| Health: %.1f | Armour: %.1f | IP: %s | Fishes: %d | Last Leaving: %s | Duty Banned: %d |", health, armour, Playersip, fishes, PlayerInfo[targetid][pWhyLeft], dban); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); format(coordsstring, sizeof(coordsstring), "| House key: %d | Business key: %d | HireKey: %d | Interior: %d | Virtual World: %d | Local: %d | Job: %s |", housekey,bizkey,HireCar[targetid],intir,virworld,local,jtext); SendClientMessage(playerid, COLOR_GRAD1,coordsstring); if (PlayerInfo[targetid][pPcarkey] != 999) {
#define STATS 1000
if (strcmp(cmd, "/stats", true) == 0) { if(IsPlayerConnected(playerid)) { if (gPlayerLogged[playerid] != 0) { new string[128]; format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stats",d,m,y,h,mi,s,sendername); ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_LIST, "STATS", "string", "Okay", "Exit"); } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in!"); return 1; } } return 1; }
if(dialogid == STATS) { if(response) { } else { return 1; } }
if(dialogid == STATS)
else
if(dialogid == 300)
if (strcmp(cmd, "/stats", true) == 0)
new string[128];
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /stats",d,m,y,h,mi,s,sendername);
if (strcmp(cmd, "/calendar", true) == 0)
C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(10257) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(10262) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(10267) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(35940) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(35946) : warning 219: local variable "string" shadows a variable at a preceding level C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(35947) : error 017: undefined symbol "d" C:\Documents and Settings\GBL\Desktop\RP\gamemodes\larp.pwn(35958) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(10257) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(10262) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(10267) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(35940) : warning 217: loose indentation C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(35947) : error 017: undefined symbol "d" C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(35946) : warning 204: symbol is assigned a value that is never used: "str" C:\Documents and Settings\GBL\Desktop\Nov FIx\gamemodes\larp.pwn(35958) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.