Author Topic: How to call the plr name?  (Read 2909 times)

0 Members and 1 Guest are viewing this topic.

Offline BadCivil

  • Street Thug
  • *
  • Posts: 22
  • VCMP,SAMP - Mapper - Scripter
    • View Profile
    • [HuN].:Magyar Xmas Freeroam:.Szerver
How to call the plr name?
« 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:


Do not print the name,what could be wrong?

Thank.
« Last Edit: November 30, 2012, 05:43:12 pm by BadCivil »
Hy all!

My web is:www.mxmasfreeroam.atw.hu Please register! :)
My YouTube account:http://www.youtube.com/user/BlackScripter1999?feature=mhee Please Subscribe! :)

Offline BadCivil

  • Street Thug
  • *
  • Posts: 22
  • VCMP,SAMP - Mapper - Scripter
    • View Profile
    • [HuN].:Magyar Xmas Freeroam:.Szerver
Re: How to call the plr name?
« Reply #1 on: December 01, 2012, 10:04:21 pm »
PLEASE HELP ME!
Hy all!

My web is:www.mxmasfreeroam.atw.hu Please register! :)
My YouTube account:http://www.youtube.com/user/BlackScripter1999?feature=mhee Please Subscribe! :)

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: How to call the plr name?
« Reply #2 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]

Offline BadCivil

  • Street Thug
  • *
  • Posts: 22
  • VCMP,SAMP - Mapper - Scripter
    • View Profile
    • [HuN].:Magyar Xmas Freeroam:.Szerver
Re: How to call the plr name?
« Reply #3 on: December 03, 2012, 12:26:50 am »
Thank Very Mach!  :-*  ;D
Hy all!

My web is:www.mxmasfreeroam.atw.hu Please register! :)
My YouTube account:http://www.youtube.com/user/BlackScripter1999?feature=mhee Please Subscribe! :)