ON PLAYERTEXT
#1

hey guys i have a problem here pls help

if(pInfo[playerid][pLevel] == 0)
{
new String[134];
format(String,sizeof(String),"%s(%d): %s",GetName(playerid),playerid,text);
SendClientMessageToAll(playerid,String);
}
if(pInfo[playerid][pLevel] == 2)
{
new String[134];
format(String,sizeof(String),"{00FF1E}[Trusted Player] {%06x}%s(%d): %s",GetPlayerColor(playerid),GetName(playerid),pla yerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),St ring);
}
if(pInfo[playerid][pLevel] >= 3)
{
new String[134];
format(String,sizeof(String),"{00FF1E}[A.D.M.I.N] {%06x}%s(%d): %s",GetPlayerColor(playerid),GetName(playerid),pla yerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),St ring);
Reply
#2

use [PHP] tags when you are posting a code on the forum and use switch for the code..

PHP код:
SendClientMessageToAll(GetPlayerColor(playerid),St ring); // this is the mistake 
PHP код:
SendClientMessageToAll(GetPlayerColor(playerid),String); // it should be this 
EDIT: This should work and its faster and optimized code.
PHP код:
switch(pInfo[playerid][Level])
{
case 
0:
{
new 
String[134];
format(String,sizeof(String),"%s(%d): %s",GetName(playerid),playerid,text);
SendClientMessageToAll(playerid,String);
}
case 
2:
{
new 
String[134];
format(String,sizeof(String),"{00FF1E}[Trusted Player] {%06x}%s(%d): %s",GetPlayerColor(playerid),GetName(playerid),playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),String);
}
case 
3:
{
new 
String[134];
format(String,sizeof(String),"{00FF1E}[A.D.M.I.N] {%06x}%s(%d): %s",GetPlayerColor(playerid),GetName(playerid),playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),String);
}

Reply
#3

this should work i think :
Код:
if(pInfo[playerid][pLevel] == 0)
{
new String[134];
format(String,sizeof(String),"%s(%d): %s",GetName(playerid),playerid,text);
SendClientMessageToAll(playerid,String);
}
if(pInfo[playerid][pLevel] == 2)
{
new String[134];
format(String,sizeof(String),"{00FF1E}[Trusted Player] {%06x}%s(%d): %s",GetPlayerColor(playerid),GetName(playerid),playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),String);
}
if(pInfo[playerid][pLevel] >= 3)
{
new String[134];
format(String,sizeof(String),"{00FF1E}[A.D.M.I.N] {%06x}%s(%d): %s",GetPlayerColor(playerid),GetName(playerid),playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),String);
Reply
#4

not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)