Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: BadCivil on November 30, 2012, 05:24:26 pm

Title: How to call the plr name?
Post by: BadCivil on November 30, 2012, 05:24:26 pm
Hy all please help me,how to call the plr name?

Ex.:if (strcmp(cmd, "freeze", true) == 0)
      {
      new Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Name,sizeof(Name));
        if(IsPlayerAdmin(playerid))
        {
        new reason[256],plr;
        tmp = strtok(cmdtext, idx),plr = FindPlayerIDFromString(tmp),reason = strtok(cmdtext, idx);
        if (!strlen(tmp) || !strlen(reason)) SendClientMessage(playerid,0x41abd1AA, "[Syntax]: /c freeze [PlayerID] [Reason]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,0x41abd1AA,"Error: Not only player");
        else
        {
        new string[256];
        format(string,sizeof(string),"Admin:[ %s ] freezed ID:[ %s ] Reason:[ %s ].",Name,gPlayers[plr],cmdtext[strlen(tmp)+7]);
        SendClientMessageToAll(0x41abd1AA, string);
        SendClientMessage(plr,0x41abd1AA,"With admin freezed!");
       TogglePlayerControllable(plr,0);
        }
        }
        }

Photo:
(http://kepfeltoltes.hu/121130/vc-mp-001_www.kepfeltoltes.hu_.jpg)

Do not print the name,what could be wrong?

Thank.
Title: Re: How to call the plr name?
Post by: BadCivil on December 01, 2012, 10:04:21 pm
PLEASE HELP ME!
Title: Re: How to call the plr name?
Post by: MatheuS on December 02, 2012, 04:28:48 pm
use type:

[pawn]format( szMsg, sizeof( szMsg ), "Admin %s Freezed player:[ %s ] Reason:[ %s ]", gPlayers[ playerid ], gPlayers[ plr ], cmdtext[ strlen( tmp ) +8 ] );
         SendClientMessageToAll( COLOR_GREEN, szMsg );
         TogglePlayerControllable( plr, 0 );[/pawn]
Title: Re: How to call the plr name?
Post by: BadCivil on December 03, 2012, 12:26:50 am
Thank Very Mach!  :-*  ;D