Jump to content
  • 0

pomoc String


Launchers

Dotaz

dcmd_ban(playerid, params[])
{
new id = strval(params);
if(spravce[playerid] != 1) return  SendClientMessage(playerid,   0xFFFFFFAA, "Niesi Admin");//ak není admin
if (!strlen(params)) return SendClientMessage(playerid, 0xFFFFFFAA, "Použití /ban id");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,     0xFFFFFFAA, "[!] Toto id neni pripojené!");//keby dal id hráča ktorý tu není
format(string, sizeof(string), "Admin %s ZABANOVAL hráce %s zo serveru!", PlayerName(playerid),PlayerName(id));//text vypíše
SendClientMessageToAll(0xFF0000AA, string);
Ban(id);//zabanuje id
return 1;
}

 

Errory :lek:

 

C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : error 017: undefined symbol "string"
C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : error 017: undefined symbol "string"
C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : error 029: invalid expression, assumed zero
C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

 

Stale mam dajaky error pre "string"

Predom za všetky odpovede dakujem ;)

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0
dcmd_ban(playerid, params[])
{
new id = strval(params);
if(spravce[playerid] != 1) return  SendClientMessage(playerid,   0xFFFFFFAA, "Niesi Admin");//ak není admin
if (!strlen(params)) return SendClientMessage(playerid, 0xFFFFFFAA, "Použití /ban id");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,     0xFFFFFFAA, "[!] Toto id neni pripojené!");//keby dal id hráča ktorý tu není
format(string, sizeof(string), "Admin %s ZABANOVAL hráce %s zo serveru!", PlayerName(playerid),PlayerName(id));//text vypíše
SendClientMessageToAll(0xFF0000AA, string);
Ban(id);//zabanuje id
return 1;
}

 

Errory :lek:

 

C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : error 017: undefined symbol "string"
C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : error 017: undefined symbol "string"
C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : error 029: invalid expression, assumed zero
C:\Documents and Settings\kosar\Desktop\gameworld.pwn(930) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

 

Je to podla Tutorialu na tom webe!

 

Stale mam dajaky error pre "string"

Predom za všetky odpovede dakujem ;)

Link to comment
Share on other sites

  • 0
A kde to mam presne dat ? :oops:

jak máš

new id = strval(params);

uprav na

new id = strval(params), string[100];

píše ti to že symbol string není nadefinován, (je neznámý) takže si nadefinuješ string který ti to potom přeformátuje do textu a ten pak zadáš do SCM nebo co tam máš ..

 

jestli jsi si četl mojí pozdější úpravu, o tom formatu, je to špatně, blbě sem to přečet :d ale to neřeš ..

 

Link to comment
Share on other sites

  • 0

No uš mám len 1 Warning :d

 

C:\Documents and Settings\kosar\Desktop\gameworld.pwn(56) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

 

Na toto :d

 

stock pName(i){
new n[MAX_PLAYER_NAME];
GetPlayerName(i, n);
return n;
}

Link to comment
Share on other sites

  • 0
No uš mám len 1 Warning :d

 

C:\Documents and Settings\kosar\Desktop\gameworld.pwn(56) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

 

Na toto :d

 

stock pName(i){
new n[MAX_PLAYER_NAME];
GetPlayerName(i, n);
return n;
}

řikal jsem ti taby jsi to tam nedával :d udělal jsem tam chybu .. kdyžtak oprav na

GetPlayerName(i, n, sizeof(n));

ale už to máš nadefinovaný .. jen jsem blbě přehlídnul a myslel sem že máš jen

format(string, sizeof(string), "bla",

ostatní bylo pod tim :d takže moje chyba ..

Link to comment
Share on other sites

  • 0
A kde to mam presne dat ? :oops:

jak máš

new id = strval(params);

uprav na

new id = strval(params), string[100];

píše ti to že symbol string není nadefinován, (je neznámý) takže si nadefinuješ string který ti to potom přeformátuje do textu a ten pak zadáš do SCM nebo co tam máš ..

 

jestli jsi si četl mojí pozdější úpravu, o tom formatu, je to špatně, blbě sem to přečet :d ale to neřeš ..

 

Dávať string hneď na začiatok kódu, keď nie je 100%-né, že sa ti splnia podmienky je trochu nešetrné.

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...