[UNSOLVED] Final Problen To Complete new GM!
#1

hello all! thanks for even taking the time to look at this!

i want to be able to set my colour to be the same, everytime i log in to my server.
i know its possible, but how do i do it?

thanks in advance...

UPDATE!
i had a friend to try and make it for me but i get 4 errors on compile:

Код:
OnPlayerSpawn(playerid)
{
if(pInfo[Logged] == 1)//you need to change pInfo to the variable u use
{
new name[24];
GetPlayerName(playerid,name,24);
if (strcmp(name, "Slash01", true) == 0)
{
SetPlayerColor(playerid,YourColor);//You need to Change YourColor to the color u wanna use
}
}
return 1;
}
then the errors:

its says that (playerid) is not defined 4 times? my friend didnt know the problem eaither

also: where can i get the include: MapIcon.inc?

THANKS!!

Reply
#2

Well the code you have is written as a normal function, when OnPlayerSpawn is actually a callback. This means it should have the word "public" in front of it. Try it like this:

pawn Код:
//Top of page
new name[24];

public OnPlayerSpawn(playerid)
{
    if(pInfo[Logged] == 1) //you need to change pInfo to the variable u use
    {
       
        GetPlayerName(playerid,name,24);
        if (!strcmp(name, "Slash01", true))
        {
            SetPlayerColor(playerid,YourColor);//You need to Change YourColor to the color u wanna use
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Weirdosport
Well the code you have is written as a normal function, when OnPlayerSpawn is actually a callback. This means it should have the word "public" in front of it. Try it like this:

pawn Код:
//Top of page
new name[24];

public OnPlayerSpawn(playerid)
{
    if(pInfo[Logged] == 1) //you need to change pInfo to the variable u use
    {
       
        GetPlayerName(playerid,name,24);
        if (!strcmp(name, "Slash01", true))
        {
            SetPlayerColor(playerid,YourColor);//You need to Change YourColor to the color u wanna use
        }
    }
    return 1;
}
i knew that :/ llol

anyway, what do i change "pinfo to?"
and mirror for Mapicon.inc?
Reply
#4

oh yh, where can i find a list of includes? sorry for double post...
Reply
#5

I would try (very easy) new playerid;
That's all. Most of the time that works.

Код:
//Top of page
new name[24];

public OnPlayerSpawn(playerid)
{
    new playerid; //this <<-------------------------
	if(pInfo[Logged] == 1) //you need to change pInfo to the variable u use
	{
		
		GetPlayerName(playerid,name,24);
		if (!strcmp(name, "Slash01", true))
		{
			SetPlayerColor(playerid,YourColor);//You need to Change YourColor to the color u wanna use
		}
	}
	return 1;
}
Reply
#6

ok, do you know the variable for the Seif Admin Script?
Reply
#7

Is it really so hard to download that filterscript which takes like 2 seconds, open it and then search around it?

It uses
pawn Код:
AccountInfo[playerid][Logged]
Reply
#8

Quote:
Originally Posted by Sergiy
Is it really so hard to download that filterscript which takes like 2 seconds, open it and then search around it?

It uses
pawn Код:
AccountInfo[playerid][Logged]
what about this then?

Код:
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(499) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(540) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(575) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(787) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(788) : warning 217: loose indentation
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(788) : error 001: expected token: "*then", but found ")"
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(788) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(794) : warning 215: expression has no effect
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(794) : warning 215: expression has no effect
Reply
#9

Show the problematic lines.
Reply
#10

Quote:
Originally Posted by Sergiy
Show the problematic lines.
ok:

Код:
C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(499) : warning 219: local variable "name" shadows a variable at a preceding level > new name[MAX_PLAYER_NAME], str[128], ip[15];

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(540) : warning 219: local variable "name" shadows a variable at a preceding level:: new name[MAX_PLAYER_NAME], str[128];

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(575) : warning 219: local variable "name" shadows a variable at a preceding level: new name[MAX_PLAYER_NAME], str[128];

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(787) :
new playerid; 

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(788) : warning 217: loose indentation: if AccountInfo[playerid][Logged] == 1) //you need to change pInfo to the variable u use

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(788) : error 001: expected token: "*then", but found ")": if AccountInfo[playerid][Logged] == 1) //you need to change pInfo to the variable u use

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(788) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(794) : warning 215: expression has no effect: SetPlayerColor(playerid,0xFFFF0F);//You need to Change YourColor to the color u wanna use

C:\Documents and Settings\Christopher\Desktop\TFZ Stunting + DM\filterscripts\tfzadmin.pwn(794) : warning 215: expression has no effect: SetPlayerColor(playerid,0xFFFF0F);//You need to Change YourColor to the color u wanna use
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)