19.08.2012, 07:00
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#pragma tabsize 0
#define message SendClientMessageToAll
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#if !defined Loop
#define Loop(%0,%1) \
for(new %0 = 0; %0 != %1; %0++)
#endif
#if !defined function
#define function%0(%1) \
forward%0(%1); public%0(%1)
#endif
#if !defined PURPLE
#define PURPLE \
0xBF60FFFF
#endif
#if !defined GREEN
#define GREEN \
0x94D317FF
#endif
#if !defined TIME
#define TIME \
256000
new D_Timer;
forward D_Messages();
new bool:CreatedRamp[MAX_PLAYERS];
new Enabled[MAX_PLAYERS];
new Ramp[MAX_PLAYERS];
new Pers[MAX_PLAYERS];
public OnFilterScriptInit(){
print("\n--------------------------------------");
print(" -= Loading... =- ");
print("--------------------------------------\n");
// MSG Timer
D_Timer = SetTimerEx("D_Messages",85000, 1, "i");
return 1;}
#endif
//-------------------------------------------------
public OnPlayerSpawn(playerid){
return 1;}
public OnFilterScriptExit(){
new i = 0;
while(i < MAX_PLAYERS){
CreatedRamp[i] = false;
DestroyObject(Ramp[i]);
i++;}
KillTimer(D_Timer);
return 1;}
public OnPlayerDisconnect(playerid){
if(CreatedRamp[playerid] == true) DestroyObject(Ramp[playerid]), CreatedRamp[playerid] = false;
CreatedRamp[playerid] = false;
Enabled[playerid]=0;
Pers[playerid]=0;
return 1;}
public OnPlayerConnect(playerid){
Enabled[playerid]=0;
Pers[playerid]=0;
return 1;}
public OnPlayerCommandText(playerid, cmdtext[]){
if (strcmp("/ramping", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 1)
{SendClientMessage(playerid, 0xFFFF00FF, "Ramping disabled!");
Enabled[playerid]=0;
Pers[playerid]=0;
return 1;}
if(Enabled[playerid] == 0){
SendClientMessage(playerid, 0xFFFF00FF, "Ramping enabled!");
SendClientMessage(playerid, 0xFFFF00FF, "Press the Special Action Key ( Ctrl or Alt Gr ) to create a ramp!");
Enabled[playerid]=1;
Pers[playerid]=1655;
return 1;}}
if (strcmp("/ramp 1", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 1!");
Pers[playerid]=1655;
return 1;}
if (strcmp("/ramp 2", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 2!");
Pers[playerid]=1632;
return 1;}
if (strcmp("/ramp 3", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 3!");
Pers[playerid]=1631;
return 1;}
if (strcmp("/ramp 4", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 4!");
Pers[playerid]=8302;
return 1;}
if (strcmp("/ramp 5", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 5!");
Pers[playerid]=1503;
return 1;}
if (strcmp("/ramp 6", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 6!");
Pers[playerid]=18451;
return 1;}
if (strcmp("/ramp 7", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 7!");
Pers[playerid]=13593;
return 1;}
if (strcmp("/ramp 8", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 8!");
Pers[playerid]=3852;
return 1;}
if (strcmp("/ramp 9", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 9!");
Pers[playerid]=16077;
return 1;}
if (strcmp("/ramp 10", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "Ramp changed to Type 10!");
Pers[playerid]=1696;
return 1;}
if (strcmp("/ramp 11", cmdtext, true, 10) == 0){
if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You have to enable ramping first! (/ramping)!");
SendClientMessage(playerid, 0xFFFF00FF, "HIT THE TIED OFFICER!!");
Pers[playerid]=3092;
return 1;}
if (strcmp("/ramp", cmdtext, true, 10) == 0){
SendClientMessage(playerid, 0xFF0000FF, "Usage: /ramp [1-11]!");
return 1;}
if (strcmp("/ramphelp", cmdtext, true, 10) == 0){
SendClientMessage(playerid, 0xFF0000FF, "Welcome to the Ramping-Info!");
SendClientMessage(playerid, 0xFFFFFFFF, "• Use /ramping to enable ramping.");
SendClientMessage(playerid, 0xFFFFFFFF, "• Use /ramp [1-5] to change the type of your ramp.");
SendClientMessage(playerid, 0xFFFFFFFF, "• To create a ramp use Special Action Key ( ''left CTRL'' or ''Alt Gr'' )");
SendClientMessage(playerid, 0xFFFFFFFF, "• To disable ramping type /ramping again.");
return 1;}
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/animhelp",true)==0){
SendClientMessage(playerid,0xFF0000FF,"Available Animations:");
SendClientMessage(playerid,0xFFFFFFFF,"Anim: /handsup /drunk /bomb /getarrested /laugh /lookout /robman");
SendClientMessage(playerid,0xFFFFFFFF,"Anim: /crossarms /lay /hide /vomit /eat /wave /taichi");
SendClientMessage(playerid,0xFFFFFFFF,"Anim: /deal /crack /smokem /smokef /sit /chat /f**ku");
SendClientMessage(playerid,0xFFFFFFFF,"Special: /cellin /cellout /beer /wine /sprunk /ciggy /pee");
SendClientMessage(playerid,0xFFFFFFFF,"Special: /inbedright /inbebleft /dance[1-4]");
SendClientMessage(playerid,0xFF0000FF,"Use SpaceBar or Enter to Quit Animation");}
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) {
// We don't handle anything here that can be used InVehicle
return 0;}
return 0;}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
if(Enabled[playerid] == 1) {
if (IsPlayerInAnyVehicle(playerid)) {
if((newkeys & KEY_ACTION) && !(oldkeys & KEY_ANALOG_UP)) {
switch(GetVehicleModel( GetPlayerVehicleID(playerid) )) {
case 592,577,511,512,593,520,553,476,519,460,513,487,488,548,425,417,497,563,447,469:
return 1;}
if(CreatedRamp[playerid] == true) DestroyObject(Ramp[playerid]), CreatedRamp[playerid] = false;
new Float:pX,Float:pY,Float:pZ,Float:vA, Arabam = GetPlayerVehicleID(playerid);
GetVehiclePos(Arabam, pX, pY, pZ);
GetVehicleZAngle(Arabam, vA);
Ramp[playerid] = CreateObject(Pers[playerid], pX + (20.0 * floatsin(-vA, degrees)), pY + (20.0 * floatcos(-vA, degrees)), pZ, 0, 0, vA);
CreatedRamp[playerid] = true;
SetTimerEx("destroy", 4000,0,"d",playerid);}}}
return 1;}
forward destroy(playerid);
public destroy(playerid){
if(CreatedRamp[playerid]==true) {
return DestroyObject(Ramp[playerid]), CreatedRamp[playerid] = false;
}else return 0;}
public D_Messages(){
new color;
new color1;
color = 0xE5E52BAA;
color1 = 0xFFFF00AA;
new D_Message=random(26);
if (D_Message == 0){
message(color1, "----------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}New players, please register /Register <PASSWORD>");
message(color1, "----------------------------------------------------------------");}
else if (D_Message == 1){
message(color1, "----------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For GENERAL commands, type /commands.");
message(color1, "----------------------------------------------------");}
else if (D_Message == 2){
message(color1, "-------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For ADMIN/ACCOUNT commands, type /lhelp.");
message(color1, "-------------------------------------------------------");}
else if (D_Message == 3){
message(color1, "-------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For VEHICLE commands, type /vmenu.");
message(color1, "-------------------------------------------------");}
else if (D_Message == 4){
message(color1, "----------------------------------------------");
message(color, "PrPBot: {FFFFFF}For HOUSE commands, type /hmenu");
message(color1, "----------------------------------------------");}
else if (D_Message == 5){
message(color1, "--------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For BUSINESS commands, type /bmenu.");
message(color1, "--------------------------------------------------");}
else if (D_Message == 6){
message(color1, "----------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For BANK commands, type /bankhelp(l).");
message(color1, "----------------------------------------------------");}
else if (D_Message == 7){
message(color1, "--------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For LAW commands, type /lawhelp(l).");
message(color1, "--------------------------------------------------");}
else if (D_Message == 8){
message(color1, "------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For MEDIC commands, type /medichelp(l).");
message(color1, "------------------------------------------------------");}
else if (D_Message == 9){
message(color1, "--------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For CRIMINAL commands, type /crimehelp(l)");
message(color1, "--------------------------------------------------------");}
else if (D_Message == 10){
message(color1, "----------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For GANG commands, type /ganghelp(l).");
message(color1, "----------------------------------------------------");}
else if (D_Message == 11){
message(color1, "--------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For TELEPORT commands, type /telehelp(l).");
message(color1, "--------------------------------------------------------");}
else if (D_Message == 12){
message(color1, "-------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For RAMP commands, type /ramphelp.");
message(color1, "-------------------------------------------------");}
else if (D_Message == 13){
message(color1, "---------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For CELLPHONE commands, type /cellhelp(l).");
message(color1, "---------------------------------------------------------");}
else if (D_Message == 14){
message(color1, "---------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For help using the new LIST UI, please type /listhelp.");
message(color1, "---------------------------------------------------------------------");}
else if (D_Message == 15){
message(color1, "------------------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Asking for ADMIN or a PROMOTION won't give you a chance at all.");
message(color1, "------------------------------------------------------------------------------");}
else if (D_Message == 16){
message(color1, "------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Use any HACK or CHEAT and you will be banned.");
message(color1, "------------------------------------------------------------");}
else if (D_Message == 17){
message(color1, "--------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF} To report hacker's, type /Report <ID> <REASON>");
message(color1, "--------------------------------------------------------------");}
else if (D_Message == 18){
message(color1, "------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Welcome to Party Rock Paradise, Enjoy and have fun!");
message(color1, "------------------------------------------------------------------");}
else if (D_Message == 19){
message(color1, "-------------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Add our 0.3d server to your favorites, 66.85.148.155:7783");
message(color1, "------------------------------------------------------------------------");}
else if (D_Message == 20){
message(color1, "------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Administrator Level 1 = VIP - Not Admin");
message(color1, "------------------------------------------------------");}
else if (D_Message == 21){
message(color1, "-------------------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Selling houses,vehicles and bizes is on your own responsibility!");
message(color1, "-------------------------------------------------------------------------------");}
else if (D_Message == 22){
message(color1, "---------------------------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}For your own safety, do not give out personal information on the server!");
message(color1, "---------------------------------------------------------------------------------------");}
else if (D_Message == 23){
message(color1, "----------------------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Add our 0.3b server to your favorites, 84.41.28.24:7872");
message(color1, "----------------------------------------------------------------------");}
else if (D_Message == 24){
message(color1, "----------------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Need Help Ask an Online admin using /admins");
message(color1, "----------------------------------------------------------");}
else if (D_Message == 25){
message(color1, "------------------------------------------------");
message(color, "PrPBot: {FFFFFF}Check out our website prpforum.tk");
message(color1, "------------------------------------------------");}
return 1;}
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;
}