14.12.2012, 23:49
(
Last edited by jdsfenix; 15/12/2012 at 01:03 AM.
)
Resolvido MT Obrigado Gente =)
format(Msg, 128, "~p~|Anuncio Admin| %s: %s", Name, Message);
COMMAND:veh(playerid, params[])
{
// Setup local variables
new VehicleModel, vID, Msg[128], Float:x, Float:y, Float:z, Float:Angle;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/veh", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 7)
{
if (sscanf(params, "i", VehicleModel)) SendClientMessage(playerid, 0xFF0000AA, "Use:/setcar [id]");
else
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, Angle);
// Spawn the vehicle at the location specified by the player (also set max-fuel and save the model for the vehicle)
vID = Vehicle_Create(VehicleModel, x, y, z, Angle, random(126), random(126), cellmax);
// Inform the player about it
format(Msg, 128, "Vocк criou o veiculo id %i (modelo-id = %i) nas coordenadas: x=%4.2f, y=%4.2f, z=%4.2f", vID, VehicleModel, x, y, z);
SendClientMessage(playerid, 0x00FF00FF, Msg);
}
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Cores Hexadecimal nгo sгo permitidas em GameText.
pawn Code:
|
COMMAND:cv(playerid, params[])
{
new Name[24], Msg[128], Message[128];
if (APlayerData[playerid][PlayerLevel] > 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
if (APlayerData[playerid][LoggedIn] == true)
{
if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Use: /cv [texto]");
else
{
for (new i; i < MAX_PLAYERS; i++)
{
if (APlayerData[i][LoggedIn] == true)
{
if (APlayerData[i][PlayerClass] == APlayerData[playerid][PlayerClass])
{
format(Msg, 128, "{FF00FF}|Anuncio Admin| %s: {FF00FF}%s", Name, Message);
SendClientMessageToAll(-1,Msg);
}
}
}
}
}
}
else
return 0;
return 1;
}
Mano ele quer que apareзa no chat
@jdsfenix: tenta assim o cmd "cv" pawn Code:
|
COMMAND:cv(playerid, params[])
{
new Name[24], Msg[128], Message[128];
if(APlayerData[playerid][PlayerLevel] > 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
if(APlayerData[playerid][LoggedIn] == true)
{
if(sscanf(params, "s[128]", Message))
return SendClientMessage(playerid, 0xFF0000AA, "Use: /cv [texto]");
for (new i; i < MAX_PLAYERS; i++)
{
if (APlayerData[i][LoggedIn] == true && APlayerData[i][PlayerClass] == APlayerData[playerid][PlayerClass]) format(Msg, 128, "{FF00FF}|Anuncio Admin| %s: {FF00FF}%s", Name, Message);
}
SendClientMessageToAll(-1,Msg);
}
}
return 1;
}
COMMAND:veh(playerid, params[])
{
new VehicleModel, vID, Msg[128], Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SendAdminText(playerid, "/veh", params);
if(APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] >= 7)
{
if(sscanf(params, "i", VehicleModel))
return SendClientMessage(playerid, 0xFF0000AA, "Use:/setcar [id]");
vID = Vehicle_Create(VehicleModel, Pos[0], Pos[1], Pos[2], 0, random(126), random(126), -1);
PutPlayerInVehicle(playerid, vID, 0);
format(Msg, 128, "Vocк criou o veiculo id %i (modelo-id = %i) nas coordenadas: x=%4.2f, y=%4.2f, z=%4.2f", vID, VehicleModel, Pos[0], Pos[1], Pos[2]);
SendClientMessage(playerid, 0x00FF00FF, Msg);
}
return 1;
}