/myinfo not effect IG
#1

Hi,

i made that command and just the " My User Inormation " is show also the " ======= " is show,
But the player info not show what is the problem ?

pawn Код:
if (strcmp("/myinfo", cmdtext, true, 10) == 0)
    {
        new string[256];
        SendClientMessage(playerid,COLOR_GREEN,"============================== My User Information ===========================================");
        format(string, sizeof(string),"[Name]%s(%d): Level[%d] - Bank[%d] - Money[%d] - Exp[%d] ",PlayerName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][pBankAccount],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Exp]);
        format(string, sizeof(string),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
        SendClientMessage(playerid,COLOR_GREEN,"==============================================================================================");
        }
Reply
#2

Add SendClientMessage(player, string); under the second format line
Reply
#3

Playerid *
Reply
#4

Quote:
Originally Posted by Socan
Посмотреть сообщение
Add SendClientMessage(playerid, string); under the second format line
One error
Код:
C:\Users\User\Desktop\samp03e_svr_R2_win32 (3)\gamemodes\Anthony.pwn(308) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

SendClientMessage(playerid, -1, string); ?
I'm half asleep lol
Reply
#6

pawn Код:
if (strcmp("/myinfo", cmdtext, true, 10) == 0)
    {
        new string[256];
        SendClientMessage(playerid,COLOR_GREEN,"============================== My User Information ===========================================");
        format(string, sizeof(string),"[Name]%s(%d): Level[%d] - Bank[%d] - Money[%d] - Exp[%d] ",PlayerName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][pBankAccount],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Exp]);
        SendClientMessage(playerid, -1, string);
        format(string, sizeof(string),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(playerid,COLOR_GREEN,"==============================================================================================");
        }
Your mistake:
You ONLY formatted the strings but never sent it to the player. (Keep in mind "format" is only used for manipulating strings, not for sending them..)
Reply
#7

Try this
pawn Код:
if (strcmp("/myinfo", cmdtext, true, 10) == 0)
    {
        new string[256];
        new string2[256];
        SendClientMessage(playerid,COLOR_GREEN,"============================== My User Information ===========================================");
        format(string, sizeof(string),"[Name]%s(%d): Level[%d] - Bank[%d] - Money[%d] - Exp[%d] ",PlayerName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][pBankAccount],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Exp]);
        format(string2, sizeof(string2),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
        SendClientMessage(playerid, COLOR_GREEN, string);
        SendClientMessage(playerid, COLOR_GREEN, string);
        SendClientMessage(playerid,COLOR_GREEN,"==============================================================================================");
        }
You just formatted the string, didn't output it.
And thats why the message didn't come
.

Edit:Aww I'm late
Mobile scripting is too slow..
Reply
#8

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
Try this
pawn Код:
if (strcmp("/myinfo", cmdtext, true, 10) == 0)
    {
        new string[256];
        new string2[256];
        SendClientMessage(playerid,COLOR_GREEN,"============================== My User Information ===========================================");
        format(string, sizeof(string),"[Name]%s(%d): Level[%d] - Bank[%d] - Money[%d] - Exp[%d] ",PlayerName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][pBankAccount],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Exp]);
        format(string2, sizeof(string2),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
        SendClientMessage(playerid, COLOR_GREEN, string);
        SendClientMessage(playerid, COLOR_GREEN, string);
        SendClientMessage(playerid,COLOR_GREEN,"==============================================================================================");
        }
You just formatted the string, didn't output it.
And thats why the message didn't come
.

Edit:Aww I'm late
Mobile scripting is too slow..
Thank god I ain't the only one who scripts on their phone..
Reply
#9

Quote:
Originally Posted by Socan
Посмотреть сообщение
SendClientMessage(playerid, -1, string); ?
I'm half asleep lol
Alright now just one line show
pawn Код:
if (strcmp("/myinfo", cmdtext, true, 10) == 0)
    {
        new string[256];
        SendClientMessage(playerid,COLOR_GREEN,"============================== My User Information ===========================================");
        format(string, sizeof(string),"[Name]%s(%d): Level[%d] - Bank[%d] - Money[%d] - Exp[%d] ",PlayerName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][pBankAccount],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Exp]);
        format(string, sizeof(string),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(playerid,COLOR_GREEN,"==============================================================================================");
    }
This line show IG
pawn Код:
format(string, sizeof(string),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
Reply
#10

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
pawn Код:
if (strcmp("/myinfo", cmdtext, true, 10) == 0)
    {
        new string[256];
        SendClientMessage(playerid,COLOR_GREEN,"============================== My User Information ===========================================");
        format(string, sizeof(string),"[Name]%s(%d): Level[%d] - Bank[%d] - Money[%d] - Exp[%d] ",PlayerName(playerid),playerid,PlayerInfo[playerid][Level],PlayerInfo[playerid][pBankAccount],PlayerInfo[playerid][pCash],PlayerInfo[playerid][Exp]);
        SendClientMessage(playerid, -1, string);
        format(string, sizeof(string),"Kills[%d] - Deaths[%d] - Adminlevel[%d] ",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pAdmin]);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(playerid,COLOR_GREEN,"==============================================================================================");
        }
Your mistake:
You ONLY formatted the strings but never sent it to the player. (Keep in mind "format" is only used for manipulating strings, not for sending them..)
Works, Repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)