14.08.2012, 20:47
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#define AM 0x00FF00
#define AX 0xFF0000
#define AY 0x0000FF
#define AN 0x000000
//#define AA
//#pragma unused a
#pragma tabsize 0
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <morphinc>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n---------------------------------------|");
print("| Utilidades SA-MP by MakeZero_TL |");
print("|----------------------------------------|");
return 1;
}
public OnFilterScriptExit()
{
print("\n|------------------------------------|");
print("| Utilidades SA-MP by MakeZero_TL |");
print("| ~> FS Descarregado <~ |");
print("|--------------------------------------|");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
//new string[556];
new cmd[256];
new tmp[256];
new idx;
//new texto;
//new nome[MAX_PLAYER_NAME];
//new Str[128];
//new id;
//sscanf2
//------------------------------------------------------
if(strcmp(cmd, "/rotacionar1", true) == 0 || strcmp(cmd, "/rt1", true) ==0)
{
if(!IsPlayerAdmin(playerid))
{
SetGameModeText("[TL] Brasil Trinity Life v2.5a");
}
else
{
SendClientMessage(playerid, AM, "Vocк nгo й ADM Rcon");
SendClientMessageToAll(AX, "%s tentou mudar o nome do servidor via '/rt1' ");
}
}
//------------------------------------------------------
if(strcmp(cmd, "/rotacionar2", true)== 0 || strcmp(cmd, "/rt2", true) ==0)
{
if(!IsPlayerAdmin(playerid))
{
SetGameModeText("[TL] Trinity Life v2.5a - Vagas de Admin");
}
else
{
SendClientMessage(playerid, AM, "Vocк nгo й ADM Rcon");
SendClientMessageToAll(AX, "%s tentou mudar o nome do servidor via '/rt2'");
}
}
if(strcmp(cmd, "/rotacionar3", true) == 0 || strcmp(cmd, "/rt3", true) ==0)
{
if(!IsPlayerAdmin(playerid))
{
SetGameModeText("[TL] Trinity Life v2.5a - Vagas de Lнder");
}
else
{
SendClientMessageToAll(AX, "%s tentou mudar o nome do servidor via '/rt2'");
}
}
if(strcmp(cmd, "/antiroubo", true) == 0 || strcmp(cmd, "/btlar", true) == 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, "MakeZero_TL", true)==0 || strcmp(name, "william_lt", true) ==0 || strcmp(name, "Drift_Patrick", true) ==0)
{
SetGameModeText("Servidor roubado! Procure o oficial! Trinity Life OWNA");
}
else
{
SendClientMessageToAll(AY, "%s tentou mudar o nome do servidor");
}
}
if(strcmp(cmd, "/radio", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, AM, "Digite '/radio ajuda' para ver os comandos");
return 1;
}
}
if(strcmp(tmp, "ajuda", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, AY, "*_____________________Sistema de Rбdio_________________________*");
SendClientMessage(playerid, AX, "| Digite '/radio lista' para listar as radios |");
SendClientMessage(playerid, AX, "| Digite '/radio tocar [id]' para tocar a radio selecionada |");
SendClientMessage(playerid, AX, "| Digite '/radio parar' para parar de tocar uma rбdio |");
SendClientMessage(playerid, AX, "| Digite '/radio sugerir' para sugerir uma rбdio |");
SendClientMessage(playerid, AY, "*______________________________________________________________*");
}
else
{
SendClientMessage(playerid, AY, "*__________________________Sistema de Rбdio________________________*");
SendClientMessage(playerid, AX, "| Digite '/radio sugerir' para sugerir uma rбdio |");
SendClientMessage(playerid, AX, "| O resto dos comandos podem ser utilizados apenas em um carro |");
SendClientMessage(playerid, AY, "*__________________________________________________________________*");
}
}
if(strcmp(tmp, "lista", true) ==0)
{
SendClientMessage(playerid, AY, "*_____________________Sistema de Rбdio_________________________*");
SendClientMessage(playerid, AM, "| 1 - Rбdio Fusion |");
SendClientMessage(playerid, AM, "| 2 - Rбdio Mix |");
SendClientMessage(playerid, AM, "| 3 - Rбdio Metropolina FM |");
SendClientMessage(playerid, AY, "*______________________________________________________________*");
}
if(strcmp(tmp, "tocar", true) ==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, AY, "*_____________________Sistema de Rбdio_________________________*");
SendClientMessage(playerid, AM, "| 1 - Rбdio Fusion |");
SendClientMessage(playerid, AM, "| 2 - Rбdio Mix |");
SendClientMessage(playerid, AM, "| 3 - Rбdio Metropolina FM |");
SendClientMessage(playerid, AY, "*______________________________________________________________*");
}
else
{
SendClientMessage(playerid, AN, "*____________________Sistema de Rбdio____________________*\n");
SendClientMessage(playerid, AM, "| Vocк nгo estб em um carro. |");
SendClientMessage(playerid, AN, "*_________________________________________________________*");
}
}
if(strcmp(tmp, "tocar 1", true) ==0)
{
PlayAudioStreamForPlayer(playerid, "http://radiofusion.com.br/fusion.asx");
}
return 1;
}
strtok(string[],&idx,seperator = ' ')
{
new ret[128], i = 0, len = strlen(string);
while(string[idx] == seperator && idx < len) idx++;
while(string[idx] != seperator && idx < len)
{
ret[i] = string[idx];
i++;
idx++;
}
while(string[idx] == seperator && idx < len) idx++;
return ret;
}
#endif