02.04.2011, 15:34
(
Последний раз редактировалось Odyssey; 01.07.2011 в 08:52.
)
/sos Filterscript by TechKid100
Edit: I know this is really old now, but I want to show you how much progess I have made! :PSo you crashed a plane or a car, and you have survived, what do you do? Most people will do /kill, thats boring, so thats why I made this SOS system. When you do /sos, your icon turns red, and this message goes to all: "[PlayerName] has called a distress signal! Their icon has turnend red, please save them!", then this message goes to the person who called SOS:"Enter /saved when you have been rescued!".
Here a some screen shots!



The server seen will be public soon!
Here is the code:
Requires ZCMD, can be easily changed to strcmp or dcmd.
pawn Код:
#include <a_samp>
#include <ZCMD>
#define COLOR_BLUE 0x0000FFFF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_YELLOW 0xFFFF00FF
enum Player
{
SOSon,
}
new PlayerInfo[MAX_PLAYERS][Player];
new SOSColor[MAX_PLAYERS];
COMMAND:sos(playerid, params[])
{
new string[192];
if (PlayerInfo[playerid][SOSon] == 1)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: Use /saved to come back from SOS!");
return 1;
}
else if (PlayerInfo[playerid][SOSon] == 0)
{
new pname[MAX_PLAYER_NAME];
SOSColor[playerid]=GetPlayerColor(playerid);
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{FF8000}%s({FFFFFF}%d{FF8000}){FFFFFF} has called a distress signal! There icon has turned {FF0000}red{FFFFFF}! Please save them!", pname,playerid);
SendClientMessageToAll(COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_BLUE, "Use /saved when you are rescued!");
SetPlayerColor(playerid, COLOR_RED);
PlayerInfo[playerid][SOSon] = 1;
return 1;
}
return 0;
}
COMMAND:saved(playerid, params[])
{
new string [128];
if (PlayerInfo[playerid][SOSon] == 0)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: Your are not in need of rescue!");
return 1;
}
else if (PlayerInfo[playerid][SOSon] == 1)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{FF8000}%s({FFFFFF}%d{FF8000}){FFFFFF} has been saved! And no longer needs help!", pname,playerid);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerColor(playerid, SOSColor[playerid]);
PlayerInfo[playerid][SOSon] = 0;
return 1;
}
return 0;
}
TechKid100 - Making the script
Rokzlive - Making it so the play icon color returns to what it was before
Thanks for taking interest!
Have fun!