SA-MP Forums Archive
/myinfo not effect IG - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /myinfo not effect IG (/showthread.php?tid=380424)



/myinfo not effect IG - BlueGames - 25.09.2012

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,"==============================================================================================");
        }



Re: /myinfo not effect IG - Socan - 25.09.2012

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


Re: /myinfo not effect IG - Socan - 25.09.2012

Playerid *


Re: /myinfo not effect IG - BlueGames - 25.09.2012

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.



Re: /myinfo not effect IG - Socan - 25.09.2012

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


Re: /myinfo not effect IG - iPLEOMAX - 25.09.2012

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..)


Re: /myinfo not effect IG - Lordzy - 25.09.2012

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..


Re: /myinfo not effect IG - Socan - 25.09.2012

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..


Re: /myinfo not effect IG - BlueGames - 25.09.2012

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]);



Re: /myinfo not effect IG - BlueGames - 25.09.2012

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.