Author Topic: How can make this to work ?  (Read 1861 times)

0 Members and 1 Guest are viewing this topic.

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
How can make this to work ?
« 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) :



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.
« Last Edit: March 24, 2012, 10:53:12 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: How can make this to work ?
« Reply #1 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.  ;)

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.