Jump to content

[REZOLVAT] Problema - Undefine


Ionut09
 Share

Recommended Posts

  • Username: Ionut09
  • Problema întălnită: nu am definit string, din codul de mai jos, am incercat cu new string[1000] si mai multe, dar nu merge, daca pun, zice ca nu e definit unde am scris new string.
  • Detalii despre problemă: -
  • Ce ai încercat să faci înainte să postezi?: -
  • Cod sursă (recomandat pastebin.com) :
    CMD:clanduty( playerid, params[ ] ) {
    	if( !PlayerInfo[ playerid ][ pClan ] )
    		return SendClientMessage( playerid, -1, "{25FDE9}EROARE: {FFFFFF}Nu esti intr-un clan." );
    	switch( ClanDuty[ playerid ] ) {
    		case 0: {
    			ClanDuty[ playerid ] = 1;
    			format(string,sizeof(string), "{25FDE9}CLAN: {FFFFFF}%s este acum la datoria clanului.", GetName( playerid ) ); // EROARE
    			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
    			SCMf( playerid, -1, "{%s}Acum esti la datoria clanului.", clanVariables[ PlayerInfo[ playerid ][ pClan ] ][ clanColor ] );
    		}
    		case 1: {
    			ClanDuty[ playerid ] = 0;
    			format(string,sizeof(string), "{25FDE9}CLAN: {FFFFFF}%s nu mai este acum la datoria clanului.", GetName( playerid ) ); //EROARE
    			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
    			SCMf( playerid, -1, "{25FDE9}CLAN: {FFFFFF}Nu mai esti la datoria clanului." );
    		}
    	}
    	return true; }

     

  • Alte detalii: -
Edited by Ionut09
Link to comment
Share on other sites

Unde vezi: 

switch( ClanDuty[ playerid ] ) {

Pune deasupra:

new str

new string[256];

 

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

1 hour ago, iMatt said:

Unde vezi: 


switch( ClanDuty[ playerid ] ) {

Pune deasupra:

new str


new string[256];

 

asa?

CMD:clanduty( playerid, params[ ] ) {
	if( !PlayerInfo[ playerid ][ pClan ] )
		return SendClientMessage( playerid, -1, "{25FDE9}EROARE: {FFFFFF}Nu esti intr-un clan." );
		new string[256];
	switch( ClanDuty[ playerid ] ) {

Nu prea am inteles :/

Link to comment
Share on other sites

Acum 3 minute, Ionut09 a spus:

asa?


CMD:clanduty( playerid, params[ ] ) {
	if( !PlayerInfo[ playerid ][ pClan ] )
		return SendClientMessage( playerid, -1, "{25FDE9}EROARE: {FFFFFF}Nu esti intr-un clan." );
		new string[256];
	switch( ClanDuty[ playerid ] ) {

Nu prea am inteles ?

Da.

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

Acum 1 minut, Ionut09 a spus:

Nu merge, tot erori, dar imi da erori la new string[256], ca nu e definit. fara imi da la alea.

Arata si erorile...

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

2 minutes ago, iMatt said:

Arata si erorile...

Ca nu am definit new string, de ce ai mai vrea, dar in fine :/

(29592) : error 017: undefined symbol "string"
(29592) : error 017: undefined symbol "string"
(29592) : error 029: invalid expression, assumed zero
(29592) : fatal error 107: too many error messages on one line

 

Link to comment
Share on other sites

  • Administrator

Cam naspa aranjarea codului facuta de @EraSy, mm

 

CMD:clanduty( playerid, params[ ] ) 
{
	if( !PlayerInfo[ playerid ][ pClan ] ) return SendClientMessage( playerid, -1, "{25FDE9}EROARE: {FFFFFF}Nu esti intr-un clan." );

	new string[128];
	switch( ClanDuty[ playerid ] ) 
	{
		case 0: 
		{
			ClanDuty[ playerid ] = 1;
			format(string, sizeof string, "{25FDE9}CLAN: {FFFFFF}%s este acum la datoria clanului.", GetName( playerid ) ); // EROARE
			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
			SCMf( playerid, -1, "{%s}Acum esti la datoria clanului.", clanVariables[ PlayerInfo[ playerid ][ pClan ] ][ clanColor ] );
		}

		case 1: 
		{
			ClanDuty[ playerid ] = 0;
			format(string, sizeof string, "{25FDE9}CLAN: {FFFFFF}%s nu mai este acum la datoria clanului.", GetName( playerid ) ); //EROARE
			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
			SCMf( playerid, -1, "{25FDE9}CLAN: {FFFFFF}Nu mai esti la datoria clanului." );
		}
	}

	return true; 
}

 

Link to comment
Share on other sites

6 minutes ago, Leonard said:

Cam naspa aranjarea codului facuta de @EraSy, mm

 


CMD:clanduty( playerid, params[ ] ) 
{
	if( !PlayerInfo[ playerid ][ pClan ] ) return SendClientMessage( playerid, -1, "{25FDE9}EROARE: {FFFFFF}Nu esti intr-un clan." );

	new string[128];
	switch( ClanDuty[ playerid ] ) 
	{
		case 0: 
		{
			ClanDuty[ playerid ] = 1;
			format(string, sizeof string, "{25FDE9}CLAN: {FFFFFF}%s este acum la datoria clanului.", GetName( playerid ) ); // EROARE
			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
			SCMf( playerid, -1, "{%s}Acum esti la datoria clanului.", clanVariables[ PlayerInfo[ playerid ][ pClan ] ][ clanColor ] );
		}

		case 1: 
		{
			ClanDuty[ playerid ] = 0;
			format(string, sizeof string, "{25FDE9}CLAN: {FFFFFF}%s nu mai este acum la datoria clanului.", GetName( playerid ) ); //EROARE
			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
			SCMf( playerid, -1, "{25FDE9}CLAN: {FFFFFF}Nu mai esti la datoria clanului." );
		}
	}

	return true; 
}

 

Tot erorile alea am, de mai sus.

Link to comment
Share on other sites

  • Administrator
CMD:clanduty( playerid, params[ ] ) 
{
	if( !PlayerInfo[ playerid ][ pClan ] ) return SendClientMessage( playerid, -1, "{25FDE9}EROARE: {FFFFFF}Nu esti intr-un clan." );

	new string[128];
	switch( ClanDuty[ playerid ] ) 
	{
		case 0: 
		{
			ClanDuty[ playerid ] = 1;
			format(string, sizeof(string), "{25FDE9}CLAN: {FFFFFF}%s este acum la datoria clanului.", GetName( playerid ) ); // EROARE
			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
			SCMf( playerid, -1, "{%s}Acum esti la datoria clanului.", clanVariables[ PlayerInfo[ playerid ][ pClan ] ][ clanColor ] );
		}

		case 1: 
		{
			ClanDuty[ playerid ] = 0;
			format(string, sizeof(string), "{25FDE9}CLAN: {FFFFFF}%s nu mai este acum la datoria clanului.", GetName( playerid ) ); //EROARE
			SendToClanMessage(PlayerInfo[playerid][pClan], -1, string);
			SCMf( playerid, -1, "{25FDE9}CLAN: {FFFFFF}Nu mai esti la datoria clanului." );
		}
	}

	return true; 
}

-

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...