[HELP] Scripting
#3

pawn Код:
if(strcmp(cmd, "/hi", true) == 0)
        {
          new tmp[256], string[256], str[256], PlayerName[24], OtherPlayerName[24];
          tmp = strtok(cmdtext, idx);
          new OtherPlayer = strval(tmp);
          GetPlayerName( OtherPlayer, OtherPlayerName, 24 );
          GetPlayerName( playerid, PlayerName, 24 );
          if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hi <playerid>");
          if(!IsPlayerConnected(OtherPlayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Playerid.");
          if(OtherPlayer == playerid) return SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You cannot say hi to yourself!");
            format(string, sizeof(string), "You have said hi to %s.", OtherPlayerName);
            format(str, sizeof(str), "%s said hi to you.", PlayerName);
          SendClientMessage(playerid, COLOR_GREEN, string);
          SendClientMessage(OtherPlayer, COLOR_GREEN, str);
            return 1;
        }
Reply


Messages In This Thread
[HELP] Scripting - by mannu - 03.05.2009, 08:15
Re: [HELP] Scripting - by MenaceX^ - 03.05.2009, 08:41
Re: [HELP] Scripting - by GTA_Rules - 03.05.2009, 09:37
Re: [HELP] Scripting - by mannu - 03.05.2009, 10:59
Re: [HELP] Scripting - by mannu - 03.05.2009, 13:30
Re: [HELP] Scripting - by HB - 03.05.2009, 15:02
Re: [HELP] Scripting - by [LSB]Clinz - 04.05.2009, 00:06

Forum Jump:


Users browsing this thread: 2 Guest(s)