Skripta koju koristim:NX
Detaljan opis problema:Pa znaÄi napravio sam komandu u dialogu (MSGBOX),ali mi je komanda(linija) bila predugaÄka i prebacio sam u novi red ali taj novi red mi pokazuje u gumbu Å¡to znaÄi da nevalja.Za detaljno imate kod.I da gledao sam neke stare teme i nerazumijem baÅ¡ ono neÅ¡ta sa stringovima Å¡ta je bilo.
Dio skripte:COMMAND:komande(playerid, params[])
{
ShowPlayerDialog(playerid, komandedialog, DIALOG_STYLE_MSGBOX, "Komande dialog", "{FFFF00}Korisnicki Racun : {FFFFFF}/stats /upgrade /changepass\n{FFFF00}Generalno : {FFFFFF}/napusti /pay /charity /time /kupi /rent /givekey /switchkey /number /pice /licenses /showlicenses\n{FFFF00}Generalno : {FFFFFF}/kuca /kupioruzje /firma /v(ozilo) /report /pomoc /new /spawnchange /lideri /ponisti /prihvati /service\n",
"{FFFF00}Generalno : {FFFFFF}/eject /usedrugs /contract /fill /clear /admins /gamemasteri\n{FFFF00}Chat : {FFFFFF}(/w)hisper(saputanje) (/o)oc (/s)hout (/c)lose(tihi chat) (/b) (/ad)vertise (/f)amily /ma(fia) chat /tognews /togfam /togwhisper\n{FFFF00}Banka : {FFFFFF}/balance /withdraw /deposit /transfer\n{FFFF00}ATM : /atmwithdraw /atmdeposit /atmbalance", "OK");
return true;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno)://
COMMAND:komande(playerid, params[])
{
new
sCommands[683]
;
strcat(sCommands, "{FFFF00}Korisnicki Racun : {FFFFFF}/stats /upgrade /changepass\n{FFFF00}Generalno : {FFFFFF}/napusti /pay /charity /time /kupi /rent /givekey /switchkey /number /pice /licenses /showlicenses\n{FFFF00}Generalno : {FFFFFF}/kuca /kupioruzje /firma /v(ozilo) /report /pomoc /new /spawnchange /lideri /ponisti /prihvati /service\n");
strcat(sCommands, "{FFFF00}Generalno : {FFFFFF}/eject /usedrugs /contract /fill /clear /admins /gamemasteri\n{FFFF00}Chat : {FFFFFF}(/w)hisper(saputanje) (/o)oc (/s)hout (/c)lose(tihi chat) (/b) (/ad)vertise (/f)amily /ma(fia) chat /tognews /togfam /togwhisper\n{FFFF00}Banka : {FFFFFF}/balance /withdraw /deposit /transfer\n{FFFF00}ATM : /atmwithdraw /atmdeposit /atmbalance");
ShowPlayerDialog(playerid, komandedialog, DIALOG_STYLE_MSGBOX, "Komande dialog", sCommands, "OK", "");
return true;
}
As simple as that. :)
Hvala ti nego sada imam jedan drugi problem trebam staviti u msgbox kada imaš neki posao,ili si u nekoj org koje komande koristiš kako to napraviti?
Evo što treba biti još u tome kodu :
if(GetPVarInt(playerid, "Posao") == 1) {
SendClientMessage(playerid,0x9292D5FF,"|Posao:/find"); }
else if(GetPVarInt(playerid, "Posao") == 9) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /sellgun /materials"); }
else if(GetPVarInt(playerid, "Posao") == 14) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /linija"); }
else if(GetPVarInt(playerid, "Posao") == 4) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /sjeme, /sadi, /beri, /obradidrogu, /selldrugs"); }
else if(GetPVarInt(playerid, "Posao") == 40) {
SendClientMessage(playerid,0x9292D5FF,"*|Posao: /leti"); }
else if(PlayerInfo[playerid][pMember] == 9) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /paper /papers /live /news [text]"); }
else if(GetPVarInt(playerid, "Posao") == 45) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /pijesak /beton /poravnaj"); }
else if(GetPVarInt(playerid, "Posao") == 68) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /elektricnivod /popravi"); }
else if(GetPVarInt(playerid, "Posao") == 63) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /selldrugs"); }
else if(GetPVarInt(playerid, "Posao") == 10) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /sellcar"); }
else if(GetPVarInt(playerid, "Posao") == 214) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /ocisti /smece"); }
else if(GetPVarInt(playerid, "Posao") == 895) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /posta"); }
else if(GetPVarInt(playerid, "Posao") == 565) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /dostavi"); }
else if(GetPVarInt(playerid, "Posao") == 7) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /refill /repair"); }
else if(GetPVarInt(playerid, "Posao") == 3) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /sex"); }
else if(GetPVarInt(playerid, "Posao") == 8) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /guard"); }
else if(GetPVarInt(playerid, "Posao") == 2) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /free"); }
else if(GetPVarInt(playerid, "Posao") == 216) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /drva"); }
else if(GetPVarInt(playerid, "Posao") == 16) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /gorivo"); }
else if(GetPVarInt(playerid, "Posao") == 337) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /hotdog"); }
else if(GetPVarInt(playerid, "Posao") == 340) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /pizza"); }
else if(GetPVarInt(playerid, "Posao") == 345) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /sladoled"); }
else if(GetPVarInt(playerid, "Posao") == 400) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /riba"); }
else if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10|| GetPVarInt(playerid, "Posao") == 14) {
SendClientMessage(playerid,0x9292D5FF,"|Posao: /fare"); }
if (IsACop(playerid))
{
SendClientMessage(playerid, 0xA1A1DAFF, "|LSPD: (/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /arrest /duty /wanted /cuff (/ta)zer");
SendClientMessage(playerid, 0xA1A1DAFF, "|LSPD: /frisk /oduzmi /ticket (/gov)ernment /deliver /camera /ram");
}
if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
{
SendClientMessage(playerid, 0xA1A1DAFF, "|LSMD: (/r)adio (/d)epartments /heal /duty");
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid, 0xACACDEFF, "|Admin: (/a)dmin (/ah)elp");
}
if (PlayerInfo[playerid][pGameMaster] >= 1)
{
SendClientMessage(playerid, 0xACACDEFF, "|GameMaster: /gm chat (/gm)help");
}
if (PlayerInfo[playerid][pInBusiness] >= 1)
{
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 1 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 5)
{
SendClientMessage(playerid, 0xACACDEFF, "|Firma: /kupi");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 7)
{
SendClientMessage(playerid, 0xACACDEFF, "|Firma: /kupioruzje");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 10)
{
SendClientMessage(playerid, 0xACACDEFF, "|Firma: /treniraj");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 3 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 10)
{
SendClientMessage(playerid, 0xACACDEFF, "|Firma: /pice");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 4 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 6 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 8)
{
SendClientMessage(playerid, 0xACACDEFF, "|Firma: /meni");
}
}
SendClientMessage(playerid, 0xACACDEFF,"|Ostalo: /kuca /firma /v(ozilo) /new /pomoc /report /hc");
SendClientMessage(playerid, 0xB3B3E0FF,"Za dodatne informacije/pomoc/upute obratite se GameMasterima/Admina ili posjetite nas Forum! ");
SCM(playerid, 0xBDBDE4FF,"________________________________________________________________________________");
}
return 1;
}
Ja ću ti dati samo za par poslova:
if (GetPVarInt(playerid, "Posao") == 1) {
strcat(sCommands, "|Posao:/find");
}
else if (GetPVarInt(playerid, "Posao") == 9) {
strcat(sCommands, "|Posao: /sellgun /materials");
}
Ali to ide prije ShowPlayerDialog() funkcije i povećaj si veliÄinu sCommands varijable.
Kako znati za koliko treba povećati stringove?Jel to koliko slova ima il kaj?
Da + joÅ¡ NULL znak. ZnaÄi zbroj znakova i onda dodaÅ¡ joÅ¡ + 1.
Problem je novi.Uradio sam sve prije ShowPlayerDialog() funkcije i povećao stringove ali imam errore evo vam komanda i errori:
1.Komanda:
COMMAND:komande(playerid, params[])
{
new sCommands[5398];
strcat(sCommands, "{FFFF00}Korisnicki Racun : {FFFFFF}/stats /upgrade /changepass\n{FFFF00}Generalno : {FFFFFF}/napusti /pay /charity /time /kupi /rent /givekey /switchkey /number /pice /licenses /showlicenses\n{FFFF00}Generalno : {FFFFFF}/kuca /kupioruzje /firma /v(ozilo) /report /pomoc /new /spawnchange /lideri /ponisti /prihvati /service\n");
strcat(sCommands, "{FFFF00}Generalno : {FFFFFF}/eject /usedrugs /contract /fill /clear /admins /gamemasteri\n{FFFF00}Chat : {FFFFFF}(/w)hisper(saputanje) (/o)oc (/s)hout (/c)lose(tihi chat) (/b) (/ad)vertise (/f)amily /ma(fia) chat /tognews /togfam /togwhisper\n{FFFF00}Banka : {FFFFFF}/balance /withdraw /deposit /transfer\n{FFFF00}ATM : {FFFFFF}/atmwithdraw /atmdeposit /atmbalance");
if (GetPVarInt(playerid, "Posao") == 1) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/find");
}
else if (GetPVarInt(playerid, "Posao") == 9) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sellgun /materials");
}
else if(GetPVarInt(playerid, "Posao") == 14) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/linija");
}
else if(GetPVarInt(playerid, "Posao") == 4) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sjeme, /sadi, /beri, /obradidrogu, /selldrugs");
}
else if(GetPVarInt(playerid, "Posao") == 40) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/leti");
}
else if(PlayerInfo[playerid][pMember] == 9) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/paper /papers /live /news [Tekst]");
}
else if(GetPVarInt(playerid, "Posao") == 45) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/pijesak /beton /poravnaj");
}
else if(GetPVarInt(playerid, "Posao") == 68) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/elektricnivod /popravi");
}
else if(GetPVarInt(playerid, "Posao") == 63) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/selldrugs");
}
else if(GetPVarInt(playerid, "Posao") == 10) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sellcar");
}
else if(GetPVarInt(playerid, "Posao") == 214) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/ocisti /smece");
}
else if(GetPVarInt(playerid, "Posao") == 895) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/posta");
}
else if(GetPVarInt(playerid, "Posao") == 565) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/dostavi");
}
else if(GetPVarInt(playerid, "Posao") == 7) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/refill /repair");
}
else if(GetPVarInt(playerid, "Posao") == 3) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sex");
}
else if(GetPVarInt(playerid, "Posao") == 8) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/guard");
}
else if(GetPVarInt(playerid, "Posao") == 2) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/free");
}
else if(GetPVarInt(playerid, "Posao") == 216) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/drva");
}
else if(GetPVarInt(playerid, "Posao") == 16) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/gorivo");
}
else if(GetPVarInt(playerid, "Posao") == 337) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/hotdog");
}
else if(GetPVarInt(playerid, "Posao") == 340) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/pizza");
}
else if(GetPVarInt(playerid, "Posao") == 345) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sladoled");
}
else if(GetPVarInt(playerid, "Posao") == 400) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/riba");
}
else if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10|| GetPVarInt(playerid, "Posao") == 14) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/fare");
}
if (IsACop(playerid))
{
strcat(sCommands,"{FFFF00}LSPD : {FFFFFF}(/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /arrest /duty /wanted /cuff (/ta)zer");
strcat(sCommands,"{FFFF00}LSPD : {FFFFFF}/frisk /oduzmi /ticket (/gov)ernment /deliver /camera /ram");
}
if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
{
strcat(sCommands, "{FFFF00}LSMD : {FFFFFF}(/r)adio (/d)epartments /heal /duty");
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
strcat(sCommands, "{FFFF00}Admin : {FFFFFF}(/a)dmin (/ah)elp");
}
if (PlayerInfo[playerid][pGameMaster] >= 1)
{
strcat(sCommands, "{FFFF00}GameMaster : {FFFFFF}/gm (chat) (/gm)help");
}
if (PlayerInfo[playerid][pInBusiness] >= 1)
{
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 1 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 5)
{
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/kupi");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 7)
{
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/kupioruzje");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 10)
{
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/treniraj");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 3 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 10)
{
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/pice");
}
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 4 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 6 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 8)
{
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/meni");
}
}
strcat(sCommands, "{FFFF00}Ostalo : {FFFFFF}/kuca /firma /v(ozilo) /new /pomoc /report /hc");
strcat(sCommands, "{FFFF00}Za dodatne informacije/pomoc/upute obratite se {37FF00}GameMasterima/{FF0000}Admina {FFFFFF}ili posjetite nas Forum! ");
}
ShowPlayerDialog(playerid, komandedialog, DIALOG_STYLE_MSGBOX, "Komande dialog", sCommands, "OK", "");
return 1;
}
Errori:
C:\Users\Dejan_Zero\Desktop\Noxicus default server\gamemodes\RLRP.pwn(13115) : warning 225: unreachable code
C:\Users\Dejan_Zero\Desktop\Noxicus default server\gamemodes\RLRP.pwn(26326) : error 021: symbol already defined: "ShowPlayerDialog"
C:\Users\Dejan_Zero\Desktop\Noxicus default server\gamemodes\RLRP.pwn(26327) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Obelezi tacno linijom gde ti je eror, postavio si celu komandu i par linija, nemoze da se vidi gde je koj eror...
i ja nzm cemu sluzi strcat, msm konta mda sluzi necemu cim je Joey_ to napisao, al zar nebi bilo lakse da koristis format ?
[quote author=
Maki187 link=topic=41570.msg312997#msg312997 date=1333645165]
Obelezi tacno linijom gde ti je eror, postavio si celu komandu i par linija, nemoze da se vidi gde je koj eror...
i ja nzm cemu sluzi strcat, msm konta mda sluzi necemu cim je Joey_ to napisao, al zar nebi bilo lakse da koristis format ?
[/quote]
LoL pa linija ti je ova: ShowPlayerDialog(playerid, komandedialog, DIALOG_STYLE_MSGBOX, "Komande dialog", sCommands, "OK", "");
svatko bi skontao.Koristim strcat jer je tako Joey poÄeo i tako sam uradio.Može pomoć?
Ovo bi trebalo raditi:
COMMAND:komande(playerid, params[])
{
new
sCommands[5398]
;
strcat(sCommands, "{FFFF00}Korisnicki Racun : {FFFFFF}/stats /upgrade /changepass\n{FFFF00}Generalno : {FFFFFF}/napusti /pay /charity /time /kupi /rent /givekey /switchkey /number /pice /licenses /showlicenses\n{FFFF00}Generalno : {FFFFFF}/kuca /kupioruzje /firma /v(ozilo) /report /pomoc /new /spawnchange /lideri /ponisti /prihvati /service\n");
strcat(sCommands, "{FFFF00}Generalno : {FFFFFF}/eject /usedrugs /contract /fill /clear /admins /gamemasteri\n{FFFF00}Chat : {FFFFFF}(/w)hisper(saputanje) (/o)oc (/s)hout (/c)lose(tihi chat) (/b) (/ad)vertise (/f)amily /ma(fia) chat /tognews /togfam /togwhisper\n{FFFF00}Banka : {FFFFFF}/balance /withdraw /deposit /transfer\n{FFFF00}ATM : {FFFFFF}/atmwithdraw /atmdeposit /atmbalance");
if (GetPVarInt(playerid, "Posao") == 1) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/find");
}
else if (GetPVarInt(playerid, "Posao") == 9) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sellgun /materials");
}
else if(GetPVarInt(playerid, "Posao") == 14) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/linija");
}
else if(GetPVarInt(playerid, "Posao") == 4) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sjeme, /sadi, /beri, /obradidrogu, /selldrugs");
}
else if(GetPVarInt(playerid, "Posao") == 40) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/leti");
}
else if(PlayerInfo[playerid][pMember] == 9) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/paper /papers /live /news [Tekst]");
}
else if(GetPVarInt(playerid, "Posao") == 45) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/pijesak /beton /poravnaj");
}
else if(GetPVarInt(playerid, "Posao") == 68) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/elektricnivod /popravi");
}
else if(GetPVarInt(playerid, "Posao") == 63) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/selldrugs");
}
else if(GetPVarInt(playerid, "Posao") == 10) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sellcar");
}
else if(GetPVarInt(playerid, "Posao") == 214) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/ocisti /smece");
}
else if(GetPVarInt(playerid, "Posao") == 895) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/posta");
}
else if(GetPVarInt(playerid, "Posao") == 565) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/dostavi");
}
else if(GetPVarInt(playerid, "Posao") == 7) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/refill /repair");
}
else if(GetPVarInt(playerid, "Posao") == 3) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sex");
}
else if(GetPVarInt(playerid, "Posao") == 8) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/guard");
}
else if(GetPVarInt(playerid, "Posao") == 2) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/free");
}
else if(GetPVarInt(playerid, "Posao") == 216) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/drva");
}
else if(GetPVarInt(playerid, "Posao") == 16) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/gorivo");
}
else if(GetPVarInt(playerid, "Posao") == 337) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/hotdog");
}
else if(GetPVarInt(playerid, "Posao") == 340) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/pizza");
}
else if(GetPVarInt(playerid, "Posao") == 345) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/sladoled");
}
else if(GetPVarInt(playerid, "Posao") == 400) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/riba");
}
else if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10|| GetPVarInt(playerid, "Posao") == 14) {
strcat(sCommands, "{FFFF00}Posao : {FFFFFF}/fare");
}
if (IsACop(playerid)) {
strcat(sCommands,"{FFFF00}LSPD : {FFFFFF}(/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /arrest /duty /wanted /cuff (/ta)zer");
strcat(sCommands,"{FFFF00}LSPD : {FFFFFF}/frisk /oduzmi /ticket (/gov)ernment /deliver /camera /ram");
}
if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) {
strcat(sCommands, "{FFFF00}LSMD : {FFFFFF}(/r)adio (/d)epartments /heal /duty");
}
if (PlayerInfo[playerid][pAdmin] >= 1) {
strcat(sCommands, "{FFFF00}Admin : {FFFFFF}(/a)dmin (/ah)elp");
}
if (PlayerInfo[playerid][pGameMaster] >= 1) {
strcat(sCommands, "{FFFF00}GameMaster : {FFFFFF}/gm (chat) (/gm)help");
}
if (PlayerInfo[playerid][pInBusiness] >= 1) {
if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 1 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 5) {
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/kupi");
}
else if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 7) {
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/kupioruzje");
}
else if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 10) {
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/treniraj");
}
else if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 3 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 10) {
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/pice");
}
else if(Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 4 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 6 || Businesses[PlayerInfo[playerid][pInBusiness]][bType] == 8) {
strcat(sCommands, "{FFFF00}Firma : {FFFFFF}/meni");
}
}
strcat(sCommands, "{FFFF00}Ostalo : {FFFFFF}/kuca /firma /v(ozilo) /new /pomoc /report /hc");
strcat(sCommands, "{FFFF00}Za dodatne informacije/pomoc/upute obratite se {37FF00}GameMasterima/{FF0000}Admina {FFFFFF}ili posjetite nas Forum! ");
ShowPlayerDialog(playerid, komandedialog, DIALOG_STYLE_MSGBOX, "Komande dialog", sCommands, "OK", "");
return 1;
}
@Maki187, strcat() funkcija služi da spoji odreÄ'en string u jedan string. Ta funkcija u biti služi za spajanje stringova. Wiki: http://wiki.sa-mp.com/wiki/Strcat
I definitivno ovdje bolje služi od format() funkcije.
Može sada,što sam bio pogriješio da znam za sljedeći puta?
EDIT:Ne radi mi komanda na serveru uopće je ne oÄitaje Å¡ta da radim?
Smanji veliÄinu stringa na nekih 1024.
Valja sada ali mi je sve rašireno po ekranu jedva vidim ali do je vjerovatno do ovoga zadnje dvije linije mi se spajaju evo pogle:
strcat(sCommands, "{FFFF00}Ostalo : {FFFFFF}/kuca /firma /v(ozilo) /new /pomoc /report /hc");
strcat(sCommands, "{FFFF00}Za dodatne informacije/pomoc/upute obratite se {37FF00}GameMasterima/{FF0000}Admina {FFFFFF}ili posjetite nas Forum! ");
Te dvije linije neće da se prebace u red jel to sad do stringova šta sam stavio 1024 ili?
Možda zato jer nisi stavio na kraj \n:
strcat(sCommands, "{FFFF00}Ostalo : {FFFFFF}/kuca /firma /v(ozilo) /new /pomoc /report /hc\n");
Citat: [SX] Joey_ poslato April 07, 2012, 21:02:51 POSLE PODNE
Možda zato jer nisi stavio na kraj \n:
strcat(sCommands, "{FFFF00}Ostalo : {FFFFFF}/kuca /firma /v(ozilo) /new /pomoc /report /hc\n");
Mene bota,ajde hvala ti care valja ti sad a ja nisam znao samo dodati \n.LoL.Lock temu.
Ništa stari. :)
Problem riješen - LOCK