SA-MP Forums Archive
Help me :D - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me :D (/showthread.php?tid=80260)



Help me :D - coole210 - 03.06.2009

I'm trying to make a /shout command but i get these errors,

Код:
(481) : error 010: invalid function or declaration
(483) : error 001: expected token: ";", but found "-identifier-"
(486) : error 010: invalid function or declaration
NOTE: i took out folder name.

Here's my /shout command

Код:
	if(strcmp("/shout",cmdtext, true, 3))
	new stringz[128]
	GetPlayerName(playerid, stringz, sizeof(stringz));
	format(stringz, sizeof(stringz), "[SHOUT]%s: %s", stringz, cmdtext[4]);
	SendClientMessageToAll(COLOR_WHITE, stringz);
		return 1;
	}



Re: Help me :D - Think - 03.06.2009

Quote:
Originally Posted by coole210
I'm trying to make a /shout command but i get these errors,

Код:
(481) : error 010: invalid function or declaration
(483) : error 001: expected token: ";", but found "-identifier-"
(486) : error 010: invalid function or declaration
NOTE: i took out folder name.

Here's my /shout command

Код:
	if(strcmp("/shout",cmdtext, true, 3))
	new stringz[128]
	GetPlayerName(playerid, stringz, sizeof(stringz));
	format(stringz, sizeof(stringz), "[SHOUT]%s: %s", stringz, cmdtext[4]);
	SendClientMessageToAll(COLOR_WHITE, stringz);
		return 1;
	}
you miss a '{' and one ';'


Код:
	if(strcmp("/shout",cmdtext, true, 3))
    {
	new stringz[128];
	GetPlayerName(playerid, stringz, sizeof(stringz));
	format(stringz, sizeof(stringz), "[SHOUT]%s: %s", stringz, cmdtext[4]);
	SendClientMessageToAll(COLOR_WHITE, stringz);
		return 1;
	}



Re: Help me :D - coole210 - 03.06.2009

Thank you but i have another problem...

Код:
	if(strcmp("/kill",cmdtext,true) == 0)
	SetPlayerHealth(playerid,0);
	SendClientMessage(playerid, COLOR_RED, "You have killed yourself.");
return 1;
}

return 0;
}
It says the
Код:
return 0;
is a
Код:
(477) : error 010: invalid function or declaration



Re: Help me :D - Backwardsman97 - 03.06.2009

pawn Код:
if(strcmp("/kill",cmdtext,true) == 0)
   {
      SetPlayerHealth(playerid,0);
      SendClientMessage(playerid, COLOR_RED, "You have killed yourself.");
      return 1;
   }
return 0;
}



Re: Help me :D - Think - 03.06.2009

your forgetting the {'s


Re: Help me :D - coole210 - 03.06.2009

Okay again a thing i need :P

I made this money system called "Tcash" just like "Rcash" from West-Side RPG it saves with my /register and /login command but i don't know how to make it so score = Tcash !

Can somebody tell me a code on how to make TCASH into score?




Re: Help me :D - Think - 03.06.2009

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++) { SetPlayerScore(i, tcash[i] /*?*/); }



Re: Help me :D - coole210 - 03.06.2009

Quote:
Originally Posted by Pandabeer1337
pawn Код:
for(new i=0;i<MAX_PLAYERS;i++) { SetPlayerScore(i, tcash[i] /*?*/); }
For tcash[i] should i put GetPlayerTcash[i] instead?

I have these commands :

Код:
GivePlayerTcash(playerid, tcash)
ResetPlayerTcash(playerid)
GetPlayerTcash(playerid)



Re: Help me :D - Think - 03.06.2009

Quote:
Originally Posted by coole210
Quote:
Originally Posted by Pandabeer1337
pawn Код:
for(new i=0;i<MAX_PLAYERS;i++) { SetPlayerScore(i, tcash[i] /*?*/); }
For tcash[i] should i put GetPlayerTcash[i] instead?

I have these commands :

Код:
GivePlayerTcash(playerid, tcash)
ResetPlayerTcash(playerid)
GetPlayerTcash(playerid)
yes if you made that by yourself than you could do this:

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++) { SetPlayerScore(i, GetPlayerTcash(i)); }



Re: Help me :D - coole210 - 03.06.2009

TYVM Ill tell you if i have another problem xD