stupid questions
#1

i cant get the witch /me question right to register
Reply
#2

Quote:
Originally Posted by rizla1986
i cant get the witch /me question right to register
are you saying you need a /me command [eg. /me is hungry] -[SU]BP13 is hungry?


- I am also looking for this
Reply
#3

Is This what you ment.....

Код:
		     }		
		     if(strcmp(cmd, "/me",true)==0)
            {
		     new dir[256];
			dir = strtok(cmdtext, idx);
			strmid(tmp, cmdtext, 4, strlen(cmdtext));
			if(!strlen(dir)) 
            {
			SendClientMessage(playerid,COLOR_GREY,"USAGE: /me [Action]");
			return 1;
			}
			dir = strtok(cmdtext, idx);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "%s: %s", sendername, tmp);
			SendClientMessageToAll(COLOR_PURPLE,string);
			print(string);
			return 1;
		    }
Is This what you Want?
Reply
#4

Quote:
Originally Posted by Shady91
Is This what you ment.....

Код:
		     }		
		     if(strcmp(cmd, "/me",true)==0)
            {
		     new dir[256];
			dir = strtok(cmdtext, idx);
			strmid(tmp, cmdtext, 4, strlen(cmdtext));
			if(!strlen(dir)) 
            {
			SendClientMessage(playerid,COLOR_GREY,"USAGE: /me [Action]");
			return 1;
			}
			dir = strtok(cmdtext, idx);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "%s: %s", sendername, tmp);
			SendClientMessageToAll(COLOR_PURPLE,string);
			print(string);
			return 1;
		    }
Is This what you Want?
Код:
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15842) : error 017: undefined symbol "cmd"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15845) : error 017: undefined symbol "idx"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15846) : error 017: undefined symbol "tmp"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15852) : error 017: undefined symbol "idx"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15853) : error 017: undefined symbol "sendername"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15853) : error 017: undefined symbol "sendername"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15853) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(15853) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#5

new tmp2[256], tmp[256];
new sendername[MAX_PLAYER_NAME];
new cmd[256];
new moneys, idx;


Add this to oncommandtext
Reply
#6

Quote:
Originally Posted by Shady91
new tmp2[256], tmp[256];
new sendername[MAX_PLAYER_NAME];
new cmd[256];
new moneys, idx;


Add this to oncommandtext
Код:
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(13740) : warning 203: symbol is never used: "moneys"
C:\DOCUME~1\Braeden\Desktop\SUPERS~1.0\SOURCE\GAMEMO~1\SU.pwn(13737) : warning 204: symbol is assigned a value that is never used: "tmp2
you can take away moneys and tmp2[256]

EDIT: It says [SU]BP13: is hungry
can't it be [SU]BP13 is hungry

Without the colon :

with the colen ( there it just looks as if you are typing normal

EDIT: Nvm easy fix:

Код:
  new tmp[256];
  new sendername[MAX_PLAYER_NAME];
  new cmd[256];
  new idx;
  if(strcmp(cmd, "/me",true)==0)
  {
  new dir[256];
	dir = strtok(cmdtext, idx);
	strmid(tmp, cmdtext, 4, strlen(cmdtext));
	if(!strlen(dir))
            {
	SendClientMessage(playerid,COLOR_GREY,"USAGE: /me [Action]");
	return 1;
	}
	dir = strtok(cmdtext, idx);
	GetPlayerName(playerid, sendername, sizeof(sendername));
	format(string, sizeof(string), "%s %s", sendername, tmp);
	SendClientMessageToAll(COLOR_GREY,string);
	print(string);
	return 1;
  }
EDIT AGAIN: Any 3 letter wotk you type even without the /me it will just say your name on the chat. if I type LALA it will come out as "[SU]BP13 A" or if I type KKK it will say "[SU]BP13" or /angry it will say "[SU]BP13 ry" even in / cmds it will say this!
Reply
#7

new idx;
new tmp[256];
new sendername[MAX_PLAYER_NAME];
new cmd[256];

Sorry was a lil stoned lastnight so i didnt look at what i was doing my bad lol
Reply
#8

If I type anything like this even without /me it will show as:

Reply
#9

Shows As what lol?
Reply
#10

pawn Код:
//top of script
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
//the color
#define COLOR_PURPLE 0x800080AA
pawn Код:
//onplayercommandtext
new cmd[256];
    if(strcmp(cmd, "/me", true) == 0)
    {
   if(IsPlayerConnected(playerid))
      {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /me [action]");
                return 1;
            }
            format(string, sizeof(string), "* %s %s", sendername, result);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            printf("%s", string);
        }
     return 1;
    }
pawn Код:
//bottom of the script

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(!BigEar[i])
                {
                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (oldposx -posx);
                    tempposy = (oldposy -posy);
                    tempposz = (oldposz -posz);
                    //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
                else
                {
                    SendClientMessage(i, col1, string);
                }
            }
        }
    }//not connected
    return 1;
}
There that works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)