/ad and /an dont work but they allmost the same as /me and /me works. help :(
#1

When I do "/ad" It said "USAGE: /ad [message]" But When I do "/ad Hello" It said "Bad Command blabla."
And that is the same for /an.

And /me works and is almost the same...

What is the problem?

Help please ;(

Код:
	if(strcmp(cmdtext,"/an",true)==0)
	{
  	new pName[MAX_PLAYER_NAME];
  	tmp = strtok(cmdtext,idx);
  	if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /an [text]");
  	if(IsPlayerConnected(playerid))
  	{
  	GetPlayerName(playerid,pName,sizeof(pName));
  	format(string,sizeof(string),"[ADMIN ANNOUNCE] %s: %s",pName,cmdtext[7]);
   	SendClientMessageToAll(COLOR_BLUE,string);
	}
	return 1;
	}
	if(strcmp(cmdtext,"/me",true)==0)
	{
  	new pName[MAX_PLAYER_NAME];
  	tmp = strtok(cmdtext,idx);
  	if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /me [action]");
  	if(IsPlayerConnected(playerid))
  	{
  	GetPlayerName(playerid,pName,sizeof(pName));
  	format(string,sizeof(string),"%s %s",pName,cmdtext[7]);
   	SendClientMessageToAll(COLOR_WHITE,string);
	}
	return 1;
	}

	if(strcmp(cmdtext,"/ad",true)==0)
	{
  	new pName[MAX_PLAYER_NAME];
 	tmp = strtok(cmdtext,idx);
  	if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ad [message]");
  	if(IsPlayerConnected(playerid))
  	{
  	if (GetPlayerMoney(playerid) >= 499)
		SendClientMessage(playerid,COLOR_RED,"You don't have 500$");
	 	}
   	GetPlayerName(playerid,pName,sizeof(pName));
   	format(string,sizeof(string),"Advertisement: %s by [%s]",cmdtext,pName[7]);
   	SendClientMessageToAll(COLOR_ORANGE,string);
   	GivePlayerMoney(playerid, -500);
	 	SendClientMessage(playerid,COLOR_ORANGE,"Your AD costed $500");
	 	return 1;
	}
Reply
#2

help please?
Reply
#3

pawn Код:
if(strcmp(cmdtext,"/an",true)==0)
    {
    new pName[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /an [text]");
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"[ADMIN ANNOUNCE] %s: %s",pName,cmdtext[7]);
    SendClientMessageToAll(COLOR_BLUE,string);
    return 1;
    }
    if(strcmp(cmdtext,"/me",true)==0)
    {
    new pName[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /me [action]");
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"%s %s",pName,cmdtext[7]);
    SendClientMessageToAll(COLOR_WHITE,string);
    return 1;
    }

    if(strcmp(cmdtext,"/ad",true)==0)
    {
    new pName[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ad [message]");
    if(IsPlayerConnected(playerid))
    {
    if (GetPlayerMoney(playerid) >= 499)
        SendClientMessage(playerid,COLOR_RED,"You don't have 500$");
        }
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"Advertisement: %s by [%s]",cmdtext,pName[7]);
    SendClientMessageToAll(COLOR_ORANGE,string);
    GivePlayerMoney(playerid, -500);
        SendClientMessage(playerid,COLOR_ORANGE,"Your AD costed $500");
        return 1;
    }
Reply
#4

Quote:
Originally Posted by [GTA
Deadly_Evil ]
pawn Код:
if(strcmp(cmdtext,"/an",true)==0)
    {
    new pName[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /an [text]");
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"[ADMIN ANNOUNCE] %s: %s",pName,cmdtext[7]);
    SendClientMessageToAll(COLOR_BLUE,string);
    return 1;
    }
    if(strcmp(cmdtext,"/me",true)==0)
    {
    new pName[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /me [action]");
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"%s %s",pName,cmdtext[7]);
    SendClientMessageToAll(COLOR_WHITE,string);
    return 1;
    }

    if(strcmp(cmdtext,"/ad",true)==0)
    {
    new pName[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ad [message]");
    if(IsPlayerConnected(playerid))
    {
    if (GetPlayerMoney(playerid) >= 499)
        SendClientMessage(playerid,COLOR_RED,"You don't have 500$");
        }
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"Advertisement: %s by [%s]",cmdtext,pName[7]);
    SendClientMessageToAll(COLOR_ORANGE,string);
    GivePlayerMoney(playerid, -500);
        SendClientMessage(playerid,COLOR_ORANGE,"Your AD costed $500");
        return 1;
    }
Dont Work.
Reply
#5

pawn Код:
new idx;
  new tmp[256];
    if(!strcmp(cmd, "/me",true) || !strcmp(cmd, "/mymessage",true))
    {
        new dir[256];
        dir = strtok(cmdtext, idx);
        strmid(tmp, cmdtext, 4, strlen(cmdtext));
        if(!strlen(dir))
        {
            SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /me [Message/Action]");
            return 1;
        }
        dir = strtok(cmdtext, idx);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s(%d) Says: %s", sendername, playerid, tmp);
        SendClientMessageToAll(COLOR_RED,string);
        print(string);
        return 1;
    }
            if(!strcmp(cmd, "/ad",true) || !strcmp(cmd, "/advertise",true))
    {
        new dir[256];
        dir = strtok(cmdtext, idx);
        strmid(tmp, cmdtext, 4, strlen(cmdtext));
        if(!strlen(dir))
        {
            SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /ad [Advertisement Name]");
            return 1;
        }
       if (GetPlayerMoney(playerid) >= 499)
        SendClientMessage(playerid,COLOR_RED,"You don't have 500$");
        }
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"Advertisement: %s by [%s]",cmdtext,pName[7]);
    SendClientMessageToAll(COLOR_ORANGE,string);
    GivePlayerMoney(playerid, -500);
        print(string);
        return 1;
    }
            if(!strcmp(cmd, "/an",true) || !strcmp(cmd, "/adminmsg",true))
    {
        new dir[256];
        dir = strtok(cmdtext, idx);
        strmid(tmp, cmdtext, 4, strlen(cmdtext));
        if(!strlen(dir))
        {
            SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /an [Message]");
            return 1;
        }
        dir = strtok(cmdtext, idx);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "[ADMIN ANNOUNCE] %s(%d): %s", sendername, playerid, tmp);
        SendClientMessageToAll(COLOR_RED,string);
        print(string);
        return 1;
    }
Reply
#6

Quote:
Originally Posted by [GTA
Deadly_Evil ]
pawn Код:
new idx;
  new tmp[256];
    if(!strcmp(cmd, "/me",true) || !strcmp(cmd, "/mymessage",true))
    {
        new dir[256];
        dir = strtok(cmdtext, idx);
        strmid(tmp, cmdtext, 4, strlen(cmdtext));
        if(!strlen(dir))
        {
            SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /me [Message/Action]");
            return 1;
        }
        dir = strtok(cmdtext, idx);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s(%d) Says: %s", sendername, playerid, tmp);
        SendClientMessageToAll(COLOR_RED,string);
        print(string);
        return 1;
    }
            if(!strcmp(cmd, "/ad",true) || !strcmp(cmd, "/advertise",true))
    {
        new dir[256];
        dir = strtok(cmdtext, idx);
        strmid(tmp, cmdtext, 4, strlen(cmdtext));
        if(!strlen(dir))
        {
            SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /ad [Advertisement Name]");
            return 1;
        }
       if (GetPlayerMoney(playerid) >= 499)
        SendClientMessage(playerid,COLOR_RED,"You don't have 500$");
        }
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"Advertisement: %s by [%s]",cmdtext,pName[7]);
    SendClientMessageToAll(COLOR_ORANGE,string);
    GivePlayerMoney(playerid, -500);
        print(string);
        return 1;
    }
            if(!strcmp(cmd, "/an",true) || !strcmp(cmd, "/adminmsg",true))
    {
        new dir[256];
        dir = strtok(cmdtext, idx);
        strmid(tmp, cmdtext, 4, strlen(cmdtext));
        if(!strlen(dir))
        {
            SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /an [Message]");
            return 1;
        }
        dir = strtok(cmdtext, idx);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "[ADMIN ANNOUNCE] %s(%d): %s", sendername, playerid, tmp);
        SendClientMessageToAll(COLOR_RED,string);
        print(string);
        return 1;
    }
Thanks!! It works now !!

But you helped me by my rape. but my rape dont work can u help with that maybe?
Reply
#7

Sorry cant understand that
Reply
#8

Edited: Nevermind
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)