mrcrowwinn 0 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 Zdravím, když napíšu příkaz /weather 10 a řádek vypadá takle if (strcmp("/weather 10", cmdtext, true) == -1) { SetPlayerWeather(playerid, 10); SendClientMessage(playerid,COLOR_GREEN,"Počasí je 10"); return 1; } Tak mi to Udělá počasí s ID 1 Proč? Link to comment Share on other sites More sharing options...
0 Lalan 0 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 Zdravím, když napíšu příkaz /weather 10 a řádek vypadá takle if (strcmp("/weather 10", cmdtext, true) == -1) { SetPlayerWeather(playerid, 10); SendClientMessage(playerid,COLOR_GREEN,"Počasí je 10"); return 0; } Tak mi to Udělá počasí s ID 1 Proč? V STRCMP nemůžeš mít mezery protože bere jen to první slovo tudíž to bere všechno dohromady(všechny příkazy které začínají weather), tím pádem to můžeš udělat např. takto /weather10 nebo /weather-10 if (strcmp("/weather-10", cmdtext, true)) { SetPlayerWeather(playerid, 10); SendClientMessage(playerid, COLOR_GREEN, "Počasí je 10"); return 0; } Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 A nebyl by nějakej skriptík, kterej by to udělal takle? Abych napsal /pocasi id a bylo by to tak...Pár jsem jich zkoušel, ale nikdy žádnej nešel Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 Když jsem to zkusil, a dal jsem to pro ID 11, tak zase házelo počasí 10. if (strcmp("/weather-11", cmdtext, true, 11) == 0) { SetPlayerWeather(playerid,11); SendClientMessage(playerid,COLOR_GREEN,"Počasí je 11"); return 1; } Link to comment Share on other sites More sharing options...
0 rhsCZ 19 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 použij dcmd u strcmp se to prohazuje divně jsme měl vl a prohazovalo se to s ls Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 Docela dost jste mi pomohli.. Začínám v pawno. Tak bych potřeboval trochu pomoct...Bylo by to možný prosím? Link to comment Share on other sites More sharing options...
0 Guest Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 Bylo. Link to comment Share on other sites More sharing options...
0 rhsCZ 19 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 Bylo. co bylo už není aneb minulý čas tj že ted to neni možné ne vtipkuju Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 Chytáte za slovíčka, jo? Ne teď doopravdy, potřeboval bych tam všechno počasí co je. Tzn. ID = 1-40. Vůbec nevím jak na to... Rouvnou bych to dal jako FS. páč jsem to tam hledal a nemohl jsem to najít. Link to comment Share on other sites More sharing options...
0 LYRIcS 88 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 V STRCMP nemůžeš mít mezery protože bere jen to první slovo tudíž to bere všechno dohromady(všechny příkazy které začínají weather), tím pádem to můžeš udělat např. takto /weather10 nebo /weather-10 [/code] netrep kok*tiny, strcmp porovnava zhodu stringov a nedba na medzery či hoci japonske znaky a ak neviete dcmd tiez pouziva strcmp btw if(!strcmp("/weather", cmdtext, true, 8)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 V STRCMP nemůžeš mít mezery protože bere jen to první slovo tudíž to bere všechno dohromady(všechny příkazy které začínají weather), tím pádem to můžeš udělat např. takto /weather10 nebo /weather-10 [/code] netrep kok*tiny, strcmp porovnava zhodu stringov a nedba na medzery či hoci japonske znaky a ak neviete dcmd tiez pouziva strcmp btw if(!strcmp("/weather", cmdtext, true, 8)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Když jsem tam dal tento kod if(!strcmp("/weather", cmdtext, true, 8)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Server padnul - zkouším po lokálu. Link to comment Share on other sites More sharing options...
0 LYRIcS 88 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 V STRCMP nemůžeš mít mezery protože bere jen to první slovo tudíž to bere všechno dohromady(všechny příkazy které začínají weather), tím pádem to můžeš udělat např. takto /weather10 nebo /weather-10 [/code] netrep kok*tiny, strcmp porovnava zhodu stringov a nedba na medzery či hoci japonske znaky a ak neviete dcmd tiez pouziva strcmp btw if(!strcmp("/weather", cmdtext, true, 8)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Když jsem tam dal tento kod if(!strcmp("/weather", cmdtext, true, 8)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Server padnul - zkouším po lokálu. to pretoze si tam nezadal parametre, napr /weather 8, daj si tam podmienku if(!strcmp("/weather", cmdtext, true, 8) && (strlen(cmdtext) >= 10)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 to pretoze si tam nezadal parametre, napr /weather 8, daj si tam podmienku if(!strcmp("/weather", cmdtext, true, 8) && (strlen(cmdtext) >= 10)) { SetPlayerWeather(playerid, strval(cmdtext[9])); new str[64]; format(str, 64, "Počasí je %d", strval(cmdtext[9])); SendClientMessage(playerid,COLOR_GREEN,str); return 1; } Super už to jde. Moc díky! Můžu to dát na pawno do FS? S tvým jménem? Link to comment Share on other sites More sharing options...
0 LYRIcS 88 Odesláno: 3. Září, 2012 Share Odesláno: 3. Září, 2012 s takouto blbostou nezkladaj zbytocny topic Link to comment Share on other sites More sharing options...
0 mrcrowwinn 0 Odesláno: 3. Září, 2012 Author Share Odesláno: 3. Září, 2012 Tak je to tam. http://pawno.cz/post318398.html#p318398 Link to comment Share on other sites More sharing options...
Dotaz
mrcrowwinn 0
Zdravím, když napíšu příkaz
/weather 10
a řádek vypadá takle
Tak mi to Udělá počasí s ID 1
Proč?
Link to comment
Share on other sites
14 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now