Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: sseebbyy on March 24, 2012, 10:30:04 pm

Title: How can make this to work ?
Post by: sseebbyy on March 24, 2012, 10:30:04 pm
Code: [Select]
else if(strcmp(cmd, "h", true) == 0) {
    tmp = strtok(cmdtext,idx);
    if(PlayerInfo[playerid][Spawned] == 0) SendClientMessage(playerid,COLOR_RED,"Error: You need to spawn first !");
else if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "Error: You need to login first!");
            else if(PlayerInfo[playerid][Status] == 0) SendClientMessage(playerid, COLOR_RED, "Error: Only Humans/Infects can use the Zombie Chat !");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN,"Error: /c h [text] !");
            else {
                for(new allh = 0; allh <= MAX_PLAYERS; allh++) {
if(PlayerInfo[allh][Status] == 1 || PlayerInfo[allh][Status] == 2) {
new string[256];
format(string,sizeof(string),">>Human Chat - %s : %s <<",gPlayers[playerid],cmdtext[strlen(tmp)+5]);
  SendClientMessage(allh,COLOR_HUMAN,string);
}
  }
}
return 1;
}

How can i made this to work ? ...

The command work , but ... (look at the picture) :

(http://img29.imageshack.us/img29/7885/vcmp000a.jpg)

When I typed "Why this not work ?" in chat appear just "is not work ?"

When I typed "yes" in chat appear just "s"

When I typed "da" (da = yes), in chat not appear .

I know, the problem is from this: cmdtext[strlen(tmp)+5] , but i don't know how need to be exactly for can appear all reason.

I never understood this.
Title: Re: How can make this to work ?
Post by: sseebbyy on March 25, 2012, 11:11:29 am
I added this:

Code: [Select]
new message[256];
strmid(message, cmdtext, 2, strlen(cmdtext));
format(string,sizeof(string),">>Human Chat - %s : %s <<",gPlayers[playerid],message);
  SendClientMessage(allh,COLOR_HUMAN,string);

and now work.

Ty for the idea.  ;)