31.03.2010, 17:55
(
Последний раз редактировалось TomTroX; 04.12.2011 в 09:46.
)
DELETE IT!
Originally Posted by JustinB
One Question how Do I make It so I wont be able to use ramps? I dont wanna use the ramps in my server
|
Originally Posted by JustinB
Lol k so I got ramps removed but how do I make it so it allows capital letters in chat? when Im running the script I cant use caps
|
SprawdzBluzgi(text[]){
for(new i=0; i < strlen(text); i++) text[i] = tolower(text[i]);
if(strfind(text, "kurwa", false) != -1) DisableWord("kurwa", text, false);
if(strfind(text, "korwa", false) != -1) DisableWord("korwa", text, false);
if(strfind(text, "huj", false) != -1) DisableWord("huj", text, false);
if(strfind(text, "hoj", false) != -1) DisableWord("hoj", text, false);
if(strfind(text, "jebac", false) != -1) DisableWord("jebac", text, false);
if(strfind(text, "jebac", false) != -1) DisableWord("jebac", text, false);
if(strfind(text, "pizda", false) != -1) DisableWord("pizda", text, false);
if(strfind(text, "cipa", false) != -1) DisableWord("cipa", text, false);
if(strfind(text, "cipo", false) != -1) DisableWord("cipo", text, false);
if(strfind(text, "cipy", false) != -1) DisableWord("cipy", text, false);
if(strfind(text, "pojeb", false) != -1) DisableWord("pojeb", text, false);
if(strfind(text, "zjeb", false) != -1) DisableWord("zjeb", text, false);
if(strfind(text, "jebany", false) != -1) DisableWord("jebany", text, false);
if(strfind(text, "cwel", false) != -1) DisableWord("cwel", text, false);
if(strfind(text, "cfel", false) != -1) DisableWord("cfel", text, false);
if(strfind(text, "dziwka", false) != -1) DisableWord("dziwka", text, false);
if(strfind(text, "spierdaj", false) != -1) DisableWord("spierdaj", text, false);
if(strfind(text, "pierdol", false) != -1) DisableWord("pierdol", text, false);
if(strfind(text, "szmata", false) != -1) DisableWord("szmata", text, false);
if(strfind(text, "suka", false) != -1) DisableWord("suka", text, false);
if(strfind(text, "zdzira", false) != -1) DisableWord("zdzira", text, false);
if(strfind(text, "wpierdol", false) != -1) DisableWord("wpierdol", text, false);
if(strfind(text, "wypierdalaj", false) != -1) DisableWord("wypierdalaj", text, false);
if(strfind(text, "wypierdolic", false) != -1) DisableWord("wypierdolic", text, false);
if(strfind(text, "jebaniec", false) != -1) DisableWord("jebaniec", text, false);
if(strfind(text, "rozkurwie", false) != -1) DisableWord("rozkurwie", text, false);
if(strfind(text, "rozkurwic", false) != -1) DisableWord("rozkurwic", text, false);
return 0;
}
DisableWord(const badword[], text[], bool:type)
{
for(new i=0; i<strlen(text); i++)
if(strfind(text[i], badword, true) == 0)
{
for(new a=0; a<strlen(text); a++)
{
if(a >= i && a < i+strlen(badword) && type == false) text[a]='*';
else if(a >= i && a < i+strlen(badword) && type == true) text[a]=' ';
}
}
}
SprawdzBluzgi(text);
SetTimer("Keys" , 100 , true ) ;
new playerramptypes[MAX_PLAYERS] = {4, ...};
new playerrampenable[MAX_PLAYERS];
new keydown[MAX_PLAYERS] = {false, ...};
new rampid[MAX_PLAYERS] = {-1, ...};
forward Keys();
public Keys()
{
new keys, updown, leftright, playerid;
new Float:x, Float:y, Float:z, Float:angle;
for (playerid = 0; playerid < MAX_PLAYERS; playerid++) {
if (IsPlayerConnected(playerid)) {
GetPlayerKeys(playerid, keys, updown, leftright);
if (keys & KEY_ACTION && IsPlayerInAnyVehicle(playerid)) {
if (!keydown[playerid]) {
keydown[playerid] = true;
if (rampid[playerid] == -1) {
GetPlayerPos(playerid, x, y, z);
angle = GetXYInFrontOfPlayer(playerid, x, y, GetOptimumRampDistance(playerid));
switch (playerramptypes[playerid]) {
case 2:
{
angle -= 90.0;
if (angle < 0.0) angle += 360.0;
z += 0.5;
}
case 1:
{
z -= 0.5;
}
}
rampid[playerid] = CreateObject(ramptypes[playerramptypes[playerid]], x, y, z - 0.5, 0.0, 0.0, angle);
SetTimerEx("RemoveRamp", 2000, 0, "d", playerid);
}
}
} else keydown[playerid] = false;
}
}
return 1;
}
new rampnames[6][] = {
{"Normal ramp"},
{"Paved ramp with pipes"},
{"Wooden board placed on the box"},
{"Water from the rock ramp"},
{"Normal ramp Water"},
{"Wide ramp Water"}
};
new ramptypes[] = {
1503,
1660,
1245,
1631,
1632,
1655,
};
if (strcmp("/setramp ", cmdtext, true, 9) == 0)
{
new ramp = strval(cmdtext[9]);
if (ramp < 0 || ramp >= sizeof(ramptypes)) {
SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid ID ramp.");
} else {
if (playerramptypes[playerid] == -1){
playerramptypes[playerid] = ramp;
SendClientMessage(playerid, COLOR_ORANGE, "Have enabled the ramp! To disable, type: /rampoff");
format(string, sizeof(string), "Ramp Type: %s (ID: %d)", rampnames[ramp], ramp);
SendClientMessage(playerid, COLOR_GREEN, string);
} else {
playerramptypes[playerid] = ramp;
format(string, sizeof(string), "Ramp has been changed to: %s (ID: %d)", rampnames[ramp], ramp);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
return 1;
}
if (strcmp("/rampoff", cmdtext, true) == 0)
{
if (playerramptypes[playerid] == -1){
SendClientMessage(playerid, COLOR_GREEN, "Already turned off the ramp!");
}else{
playerramptypes[playerid] = -1;
SendClientMessage(playerid, COLOR_ORANGE, "Turned off the ramp! To enable, type / setramp [0-5].");
}
return 1;
}
public OnFilterScriptExit()
{
for (new i=0; i<GetMaxPlayers(); i++)
{
if (rampid[i] != -1) DestroyObject(rampid[i]);
}
}
forward RemoveRamp(playerid);
public RemoveRamp(playerid)
{
if (rampid[playerid] != -1) {
DestroyObject(rampid[playerid]);
rampid[playerid] = -1;
}
return 1;
}
playerrampenable[playerid] = 1;
forward Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
else GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
forward Float:GetOptimumRampDistance(playerid);
Float:GetOptimumRampDistance(playerid)
{
new ping = GetPlayerPing(playerid), Float:dist;
dist = floatpower(ping, 0.25);
dist = dist*4.0;
dist = dist+5.0;
return dist;
}