SA-MP Forums Archive
ON PLAYERTEXT - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ON PLAYERTEXT (/showthread.php?tid=612658)



ON PLAYERTEXT - Loinal - 20.07.2016

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);


Re: ON PLAYERTEXT - Logic_ - 20.07.2016

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);
}




Re: ON PLAYERTEXT - FuNkYTheGreat - 20.07.2016

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);



Re: ON PLAYERTEXT - Loinal - 20.07.2016

not working