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; }
//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;
}
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) { 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; }
AccountInfo[playerid][Logged]
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 Код:
|
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
Originally Posted by Sergiy
Show the problematic lines.
|
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