How i fix those errors
#1

: warning 219: local variable "pName" shadows a variable at a preceding level
: error 017: undefined symbol "pName"
: error 017: undefined symbol "PlayerInfo"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: error 029: invalid expression, assumed zero

on:

CMDm(playerid,params[])
{

new id,msg[128],str2[128];
if(sscanf(params,"us[128]",id,str2)) return SendClientMessage(playerid,-1,"USAGE: /pm [playerid] [Message]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Error: That Player Is Not Connected");
format(msg,sizeof(msg),"PM To %s (ID: %d): %s",pName(id),id,str2);
SendClientMessage(playerid,0xFF00FFFF,msg);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(msg,sizeof(msg),"PM From Admin %s (ID: %d): %s",pName(playerid),playerid,str2);
SendClientMessage(id,0xFF00FFFF,msg);
}
else
{
format(msg,sizeof(msg),"PM From %s (ID: %d): %s",pName(playerid),playerid,str2);
SendClientMessage(id,0xFF00FFFF,msg);
}
return 1;
}
Reply
#2

Pretty simple, It tells you the issue,
You're attempting to call pName which i'm guessing is an enum you've put into the script..
as you've not actually given the code where you've created this value i'm assuming it's an enum stored in PlayerInfo
So to call "pName" you need to
Код:
PlayerInfo[playerid][pName] 
_
for the PlayerInfo, try assigning an admin value
new aLevel = PlayerInfo[playerid][pAdmin];
if(aLevel >= 1) { 
 blahblah
}
These are just assumptions as the only thing you've given is the code snippet and not the preexisting code that it relates too
Reply
#3

Well. i realy can't understand, may the reason i just started scripting, the real thing what i want to do is to script the register login system and save accounts datas
can you help me ?
Reply
#4

Take a look at some tutorials and then try to learn.
Reply
#5

Quote:
Originally Posted by SuperBB
Посмотреть сообщение
Well. i realy can't understand, may the reason i just started scripting, the real thing what i want to do is to script the register login system and save accounts datas
can you help me ?
Again, that depends on if you're using SQL or ini

If you're using SQL which seems to be the norm, you could just create an array to store the information until the player logs out.

when they logout if the account is not preexisting then insert that information into that SQL
if the account does exist use an update statement to update the player info

_
But as the above poster said, It's probably best you read up on some tutorials before even trying to make a registration system.
It's not hard to make one but if you're new to scripting, looking at some tutorials would be a great thing to do.

I'd suggest start out by making a simple text based registration system before a dialogbox one as you're new

So simply create a /login and /register command
Reply
#6

can you give me your fb? i have an some other issues. i would appreciate it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)