Jump to content
  • 0

pomoc GetPlayerName


kkaaaj01

Dotaz

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

  • 0

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

  • 0

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

  • 0

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

  • 0

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...