Question? (+1 rep for you :)) -
Andrew97 - 16.04.2012
I want to count the players so I will make:
new players
Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,RED,"Welcome to Player Rights Server");
SendClientMessage(playerid,YELLOW,"Admins are here to Help you if they Did anything Wrong Just tell the Owner");
SendClientMessageToAll(RED,"A player has Joined the Game");
new string[128];
format(string, sizeof(string), "there are Currently %d players online", players);
SendClientMessage(playerid, -1, string);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SendClientMessage(playerid,RED,"Hope to you to Come Back");
new string[128];
format(string, sizeof(string), "there are Currently %d online", players);
SendClientMessage(playerid, -1, string);
return 1;
}
okay I want make a New String in onplayerconnect how Can I do that?
When I do a new string onplayerconnect
it get me this Error:
D:\Script\gamemodes\FR.pwn(84) : error 021: symbol already defined: "string"
Help me please!!
Re: Question? (+1 rep for you :)) -
ProdrifterX - 16.04.2012
pawn Код:
new sPlay[64];
format(sPlay, sizeof(sPlay), "*** There are curently players %i/%i online", player_count, GetMaxPlayers());
SendClientMessageToAll(COLOR_GREY, sPlay);
U can add this on player connect,spawn,disconnect.. etc.
Rep Nao :P
Re: Question? (+1 rep for you :)) -
ProdrifterX - 16.04.2012
and add this on player connect
And this on playerdisconnect
REEEP!
Re: Question? (+1 rep for you :)) -
RollTi - 16.04.2012
remove the new string[128];
theres already one
don't forget to
pawn Код:
//OnPlayerConnect
player++;
//OnPlayerDisconnect
player--;
Quote:
Originally Posted by ProdrifterX
pawn Код:
new sPlay[64]; format(sPlay, sizeof(sPlay), "*** There are curently players %i/%i online", player_count, GetMaxPlayers()); SendClientMessageToAll(COLOR_GREY, sPlay);
U can add this on player connect,spawn,disconnect.. etc.
Rep Nao :P
|
Quote:
Originally Posted by ProdrifterX
and add this on player connect
And this on playerdisconnect
REEEP!
|
Stop double posting there is edit button
Re: Question? (+1 rep for you :)) -
doreto - 16.04.2012
Quote:
Originally Posted by Andrew97
D:\Script\gamemodes\FR.pwn(84) : error 021: symbol already defined: "string"
|
thats mean you already use string wich same name just re-name other string example "astring"
Re: Question? (+1 rep for you :)) -
ProdrifterX - 16.04.2012
Quote:
Originally Posted by RollTi
remove the new string[128];
theres already one
don't forget to
pawn Код:
//OnPlayerConnect
player++;
//OnPlayerDisconnect
player--;
Stop double posting there is edit button
|
Sorry sir.
Re: Question? (+1 rep for you :)) -
Andrew97 - 16.04.2012
Thanks Guys!! but @prodrifter Can you explain for me this Code please BTW your REp is+1