25.10.2011, 20:35
tb tive esse probleminha.. olha um fs ai.. perfeito eu acho =p fiz pra vc.. e so usar a inc.. e pronto !!!
[Include] Neon Library
https://sampforum.blast.hk/showthread.php?tid=262451
By ApolloRJ
pawn Код:
#include <a_samp>
#include <Neon>
//----- DIALOG ----------------//
#define DIALOG_NEON 300
//----------------------------------------------------------------------------//
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" FS Neon V1 By ApolloRJ");
print("--------------------------------------\n");
return 1;
}
//----------------------------------------------------------------------------//
public OnFilterScriptExit()
{
return 1;
}
//----------------------------------------------------------------------------//
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[130];
new idx;
cmd = strtok(cmdtext, idx);
//----------------------------------------------------------------------------//
if(strcmp(cmd, "/neon", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ ERROR ]{FFFFFF} Vocк Nгo Esta Em Um Veнculo!!");
ShowPlayerDialog(playerid, DIALOG_NEON, DIALOG_STYLE_LIST, "{FFFF00}Menu {FFFFFF}Neon","[ Azul ]\n[ Vermelho ]\n[ Verde ]\n[ Branco ]\n[ Rosa ]\n[ Amarelo ]\n[ Undercover ]\n[ Desligue Neon ]","OK","Sair");
return 1;
}
return 0;
}
//----------------------------------------------------------------------------//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_NEON)
{
if(response)
{
if(listitem == 0)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_BLUE);
GameTextForPlayer(playerid, "~b~Azul~w~ Neon foi Adicionado Ao Seu Veiculo",2000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 1)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_RED);
GameTextForPlayer(playerid, "~r~Vermelho~w~ Neon foi Adicionado Ao Seu Veiculo",3000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 2)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_GREEN);
GameTextForPlayer(playerid, "~g~Verde~w~ Neon foi Adicionado Ao Seu Veiculo",3000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 3)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_WHITE);
GameTextForPlayer(playerid, "~w~Branco Neon foi Adicionado Ao Seu Veiculo",3000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 4)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_PINK);
GameTextForPlayer(playerid, "~p~Rosa~w~Neon foi Adicionado Ao Seu Veiculo",3000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 5)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_YELLOW);
GameTextForPlayer(playerid, "~y~Amarelho~w~Neon foi Adicionado Ao Seu Veiculo",3000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 6)
{
AttachNeonToVehicle(GetPlayerVehicleID(playerid), NEON_POLICE);
GameTextForPlayer(playerid, "Undercover~w~ Neon foi Adicionado Ao Seu Veiculo",3000,5);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
SetPlayerTime(playerid,0,0); //noite
}
if(listitem == 7)
{
new vehicleid = GetPlayerVehicleID( playerid );
RemoveNeonFromVehicle( vehicleid );
GameTextForPlayer(playerid, "~g~Neon Foi Excluido De Seu Veiculo",3000,5);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0); //sound
SetPlayerTime(playerid,12,0); //dia
}
}
return 1;
}
return 0;
}
//----------------------------------------------------------------------------//
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
//----------------------------------------------------------------------------//
//-------- F I M -------------------------------------------------------------//
//----------------------------------------------------------------------------//
https://sampforum.blast.hk/showthread.php?tid=262451
By ApolloRJ