for( new i = 0; i != MAX_PLAYERS; i++ )
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i) == vehicleid)
{
if(IsMask[playerid] == 1)
{
format(string, sizeof(string), "(VEHICLE) Stranger says: %s", text);
SendClientMessage(i, COLOR_FADE2, string);
}
else
{
format(string, sizeof(string), "(VEHICLE) %s says: %s", sendername, text);
SendClientMessage(i, COLOR_FADE2, string);
}
return 0;
}
}
for( new i = 0; i != MAX_PLAYERS; i++ )
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i) == vehicleid)
{
if(IsMask[playerid] == 1)
{
printf("Entering the branch"); // <<<<
format(string, sizeof(string), "(VEHICLE) Stranger says: %s", text);
SendClientMessage(i, COLOR_FADE2, string);
printf("Exiting the branch"); // <<<<
}
else
{
format(string, sizeof(string), "(VEHICLE) %s says: %s", sendername, text);
SendClientMessage(i, COLOR_FADE2, string);
}
return 0;
}
}
|
Let's try to debug your function. It is pretty simple idea: just see, if you even enter sufficient branch of code:
pawn Код:
Give it a try. |
|
I did that....when checking the logs that "Entering the branch" and "Exiting the branch" does not appear.
|
IsMask[playerid] = 1;
|
This probably means that the variable IsMask[playerid] does not equal to one, which is the condition you have placed upon the execution of the code.
To check if this is the error, you could debug by placing Код:
IsMask[playerid] = 1; |
if(IsMask[playerid] == 1)
{
format(string, sizeof(string), "%s Stranger says: %s", accent, text);
ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
return 0;
}
format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
|
Well,i believe the IsMask[playerid] = 1; is activated good on the command mask because it works on other situtations
Example: Код:
if(IsMask[playerid] == 1)
{
format(string, sizeof(string), "%s Stranger says: %s", accent, text);
ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
return 0;
}
format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
|