Facepalm Command!?
#9

Hmm, I actually hoped you didnt have sscanf and zcmd, i specially wroted and tested it for you, since you share my name (my name isnt Mike but Martin)

pawn Код:
new cmd[128], tmp[128];
    tmp = strtok(cmdtext, idx);
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/fp", true) == 0)
    {
    if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /fp [id]");
    if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected.");
    new str[128],fpname[MAX_PLAYER_NAME],myname[MAX_PLAYER_NAME];
    GetPlayerName(strval(tmp),fpname,sizeof(fpname));
    GetPlayerName(playerid,myname,sizeof(myname));
    format(str,128,"%s facepalms on %s's comment.",myname,fpname);
    SendClientMessageToAll(0xFF66FFAA,str);
    return 1;
    }
copy paste it right into onplayercommandtext and no errors will show up, if the 'cmd' and 'tmp' variables arent defined yet.


edit: EDITED and works now if done correctly.
Reply


Messages In This Thread
Facepalm Command!? - by martin3644 - 18.12.2012, 18:59
Re: Facepalm Command!? - by martin3644 - 18.12.2012, 19:07
Re: Facepalm Command!? - by LetsOWN[PL] - 18.12.2012, 19:12
Re: Facepalm Command!? - by martin3644 - 18.12.2012, 19:14
Re: Facepalm Command!? - by LetsOWN[PL] - 18.12.2012, 19:14
Re: Facepalm Command!? - by martin3644 - 18.12.2012, 19:17
Re: Facepalm Command!? - by yaron0600 - 18.12.2012, 19:23
Re: Facepalm Command!? - by Mr.Anonymous - 18.12.2012, 19:24
Re: Facepalm Command!? - by Mike_Peterson - 18.12.2012, 19:24
Re: Facepalm Command!? - by martin3644 - 18.12.2012, 19:33

Forum Jump:


Users browsing this thread: 2 Guest(s)