Offline Player Command
#1

Hello!
I was trying to chek last player's login with a command.
I get : (25429) : error 035: argument type mismatch (argument 1)

PHP код:
CMD:online(playeridparams[])
{
    new 
str[28],path[50],pLastOn20 20 ],OnlineString128 ],INI:file;
    if(
sscanf(params,"s[30]",str)) return SendClientMessage(playerid,-1,"Usage: /online [name]");
    
format(path,sizeof(path),"Accounts/%s.ini",str);
    if ( 
INI_Existpath ) )
    {
        
file INI_Open(path);
        
GetPVarStringstr"On"pLastOnsizeof pLastOn );//25429
        
formatOnlineString,sizeof(OnlineString),"["REDSV"%s"BLUESV"] last Online time is "REDSV"%s.",str,pLastOn);
        
SCM(playerid,BLUES,OnlineString);
        
INI_Close(file);
    }
    else
    {
        
SendClientMessage(playerid,-1,"User in not registered.");
    }
    return 
1;

Reply
#2

Show the line 25429.
Reply
#3

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
Show the line 25429.
Код:
 GetPVarString( str, "On", pLastOn, sizeof pLastOn );//25429
Are you blind?
Reply
#4

https://sampwiki.blast.hk/wiki/GetPVarString ,GetPVarString(playerid,....
Reply
#5

Oh sorry dint saw that.

OT:
Since it says "argument type mismatch (argument 1)", then there's some problem with str.

EDIT:
Yeah. There's no playerid there.
Reply
#6

I know its playerid,but I don't know how to replace playerid with the offline user checked,watch the command,omfg!

Anyone who's not stupid can help me? Thank you!

str = playerid parameter,but I am trying to replace that offline playerid with str.
Reply
#7

Quote:
Originally Posted by SumX
Посмотреть сообщение
Anyone who's not stupid can help me? Thank you!
Well then, if you're smart enough, try to solve this by yourself. We are just trying to help you by what we know!
Reply
#8

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
Well then, if you're smart enough, try to solve this by yourself. We are just trying to help you by what we know!
Not you! That one,who is showing me the getpvarstring function!
Reply
#9

Quote:
Originally Posted by SumX
Посмотреть сообщение
I know its playerid,but I don't know how to replace playerid with the offline user checked,watch the command,omfg!

Anyone who's not stupid can help me? Thank you!

str = playerid parameter,but I am trying to replace that offline playerid with str.
I know what is the problem. But because you are (acting as) a dog I will not tell you anything. If anyone else has same question PM me. Peace!
Reply
#10

Quote:
Originally Posted by SumX
Посмотреть сообщение
I know its playerid,but I don't know how to replace playerid with the offline user checked,watch the command,omfg!

Anyone who's not stupid can help me? Thank you!

str = playerid parameter,but I am trying to replace that offline playerid with str.
Solution:

the variable str is a string and the function expects the first parameter to be a playerid. Playerid is an integer, however. Therefore, you will get a tag mismatch. A tag mismatch simply states that the specified variable type does not comply with the variable type requested.

And there you have it. No need to go all fuzzy about "PM ME FOR SOLUTION PLOX" or action like a total turd. If you want help, act like someone who is in need of one and don't try to be a total douche. Also, if you are 'so smart' you could've looked the function up on the wiki yourselves and found out what the error meant in the pawn-lang.pdf. Instead of all that, you come to the forum and like a prick to others. Good luck in the future.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)