kkaaaj01 0 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 Ahoj, potřeboval bych prosím poradit. chci udělat podmínku, že se něco udělá pouze pokud má ten hráč určitý nick. jenže sem se do toho nějak zamotal. stock Jmeno(playerid) { new name[26]; GetPlayerName(playerid, name, 26); return name; } a pak tam bude teda asi if (sem_nevím_co_mám_dát == "ten_nick") Link to comment Share on other sites More sharing options...
0 fabbeN 3 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 -nemáš tag [HELP] if (strcmp(name, "MENO", true)!= 0) { funkce... Link to comment Share on other sites More sharing options...
0 Guest SpiRinG Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 skus to niejak podla tohto viewtopic.php?f=135&t=25180&p=265867 Link to comment Share on other sites More sharing options...
0 kkaaaj01 0 Odesláno: 3. Červenec, 2012 Author Share Odesláno: 3. Červenec, 2012 C:\Games\gta\svr\filterscripts\me6i.pwn(25) : warning 217: loose indentation C:\Games\gta\svr\filterscripts\me6i.pwn(25) : error 017: undefined symbol "name" C:\Games\gta\svr\filterscripts\me6i.pwn(37) : error 029: invalid expression, assumed zero C:\Games\gta\svr\filterscripts\me6i.pwn(37 -- 38) : warning 215: expression has no effect C:\Games\gta\svr\filterscripts\me6i.pwn(38) : error 001: expected token: ";", but found "return" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. to od 37 řádku by mělo dávat smysl až když bude dávat smysl řádek 25 Link to comment Share on other sites More sharing options...
0 fabbeN 3 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 new name[50]; GetPlayerName(playerid,name,sizeof(name)); odtabuj si to a daj riadky... Link to comment Share on other sites More sharing options...
0 AvestX 5 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 používej stock GpName(i){ new n[27]; GetPlayerName(i, n, sizeof(n)); return n; } tato "funkce" zjistí hráčovo jméno a také ho vrací, takže můžeš využívat když formatujes a podobne .. jinak jak zjistit zda je hracovo jmeno totozne s necim tak strcmp if(!strcmp(GpName(playerid), "jmeno stejne s timto", false)){ funkce scriptu } neco v tom stylu .. Link to comment Share on other sites More sharing options...
0 kkaaaj01 0 Odesláno: 3. Červenec, 2012 Author Share Odesláno: 3. Červenec, 2012 Díky, jde to, jenom se to nastavil obráceně takže z toho nicku to nejde a ze všech ostatních jo, ale to už dám do hromady sám. Link to comment Share on other sites More sharing options...
0 kkaaaj01 0 Odesláno: 3. Červenec, 2012 Author Share Odesláno: 3. Červenec, 2012 C:\Games\gta\svr\filterscripts\me6i.pwn(22) : warning 217: loose indentation nevím proč, ale z toho nicku pro který to je to nejde udělat if(auto == 2) return SCM(playerid,0xFF0000FF,"[ ! ] Jedno auto Ti stačí. Použij /dauto pro smazání předchozího."); if(!strcmp(GpName(playerid), "ten_nick", false)) return SCM(playerid,BARVA_BILA, "[ ! ] Nejsi ten_nick !"); else blbabla//*script na spawnutí auta*// Link to comment Share on other sites More sharing options...
0 AvestX 5 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 #pragma tabsize 0 pod #include Link to comment Share on other sites More sharing options...
0 kkaaaj01 0 Odesláno: 3. Červenec, 2012 Author Share Odesláno: 3. Červenec, 2012 stále to jde spawnout z jineho nicku a pri spawnuti to píše "unknown command" ale spawne to Link to comment Share on other sites More sharing options...
0 AvestX 5 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 nezna prikaz OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp("/prikaz", cmdtext, true, 10)) { return 1; } if(!strcmp("/prikaz2", cmdtext, true, 10)) { return 1; } return false; } btw, koukni se na sa-mp.wiki na strcmp Link to comment Share on other sites More sharing options...
0 kkaaaj01 0 Odesláno: 3. Červenec, 2012 Author Share Odesláno: 3. Červenec, 2012 potřevoval bych, aby výsledek if (!strcmp(GpName(playerid), "ten_nick", false)) byl záporný a po tom return zpráva nejsi ten nick else spawn car Link to comment Share on other sites More sharing options...
0 kell94_cz 7 Odesláno: 3. Červenec, 2012 Share Odesláno: 3. Červenec, 2012 if(!strcmp(GpName(playerid), "ten_nick", true)) Pokud má hráč ten_nick { sem co se vykoná }else{ sem co se vykoná když nemá hráč ten zadaný nick } return true; } Link to comment Share on other sites More sharing options...
0 kkaaaj01 0 Odesláno: 3. Červenec, 2012 Author Share Odesláno: 3. Červenec, 2012 Dík, hotovo Link to comment Share on other sites More sharing options...
Dotaz
kkaaaj01 0
Ahoj, potřeboval bych prosím poradit. chci udělat podmínku, že se něco udělá pouze pokud má ten hráč určitý nick. jenže sem se do toho nějak zamotal.
stock Jmeno(playerid)
{
new name[26];
GetPlayerName(playerid, name, 26);
return name;
}
a pak tam bude teda asi
if (sem_nevím_co_mám_dát == "ten_nick")
Link to comment
Share on other sites
13 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