/pm problems
#1

I have this as my /pm command. It compiles without error. However in game, when i try to send a /pm, it always tells me Usage: /pm (id) (message). Can someone help me out in finding what is going wrong?

pawn Код:
if(strcmp(cmd,"/pm", true)==0)
    {
        new pName[256];
        new iName[256];
        new gMessage[256];
        new Message[256];
        #define strrest

    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /PM (id) (message)");
    new id = strval(tmp);
    gMessage[5] = strrest(cmdtext,idx);
    if(!strlen(gMessage)) return SendClientMessage(playerid,0xFF0000FF,"Usage: /pm (id) (message)");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"/pm :Invalid ID");
    GetPlayerName(id,iName,sizeof(iName));
    GetPlayerName(playerid,pName,sizeof(pName));
    format(Message,sizeof(Message),">> %s(%i): %s",iName,id,gMessage);
    SendClientMessage(playerid,0xFFD720FF,Message);
    format(Message,sizeof(Message),"** %s(%i): %s",pName,playerid,gMessage);
    SendClientMessage(id,0xFFD720FF,Message);
    PlayerPlaySound(id,1085,0.0,0.0,0.0);
    return 1;
    }
Reply


Messages In This Thread
/pm problems - by Rhemsis - 14.11.2009, 19:05
Re: /pm problems - by Donuts - 14.11.2009, 21:16
Re: /pm problems - by jamesb93 - 14.11.2009, 21:44
Re: /pm problems - by cristab - 14.11.2009, 21:49
Re: /pm problems - by Rhemsis - 14.11.2009, 22:52
Re: /pm problems - by jamesb93 - 14.11.2009, 22:56
Re: /pm problems - by Rhemsis - 14.11.2009, 23:05
Re: /pm problems - by jamesb93 - 14.11.2009, 23:18
Re: /pm problems - by Rhemsis - 14.11.2009, 23:24
Re: /pm problems - by Rhemsis - 16.11.2009, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)