19.02.2009, 14:10
I also fixed your indentitation but the forum fucks it up a bit.
pawn Код:
#include <a_samp>
#include <xClient>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARK_RED 0xAA3333AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000AA20
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_SPAM 6
new SpamStrings[MAX_PLAYERS];
main()
{
print("\n----------------------------------");
print(" ~ Ultimate Clean GM by Hot ~");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("Stunt•Freeroam•DM•Fun");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_GREEN, "Welcome San Andreas Stunters, Have fun!");
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s has joined the server.", pName);
SendClientMessageToAll(COLOR_GREY, string);
if(!strcmp("[ViP]Labrik",pName,true) || !strcmp("netzeek",pName,true) || !strcmp("[MT]Lavis",pName,true))
{
new kstring[128];
format(kstring, sizeof(kstring), "%s was auto kicked from the server (illegal name).", pName);
SendClientMessageToAll(COLOR_GREY, kstring);
print(kstring);
Kick(playerid);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
switch(reason)
{
case 0: format(String, sizeof(String), "%s lost connection to the server. (timeout)", PName);
case 1: format(String, sizeof(String), "%s has left the server.", PName);
case 2: format(String, sizeof(String), "%s has left the server. (kicked)", PName);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, 100);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
FadePlayerScreen(playerid, 0xFFFFFFCC, 6, 192);
GameTextForPlayer(playerid,"~w~OMG, CALL THE AMBULANCE!",1000,1);
SendDeathMessage(killerid, playerid, reason);
GameTextForPlayer(killerid,"~r~You Murderer!",4000,3);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
SpamStrings[playerid] ++;
if(SpamStrings[playerid] >= MAX_SPAM)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
printf("(previous text of %s was blocked by antispam)", PlayerName);
SendClientMessage(playerid,0xCC0000AA,"Please wait 20 seconds before you spam again (spam protection).");
return 0;
}
new textstring[128];
format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
SendPlayerMessageToAll(playerid, textstring);
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/parachute", true) == 0)
{
GivePlayerWeapon(playerid, 46, 1);
SendClientMessage(playerid,COLOR_GREEN,"Use it well!");
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
return 1;
}
if (strcmp(cmdtext, "/flip", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:PX, Float:PY, Float:PZ, Float:PA;
GetPlayerPos(playerid, PX, PY, PZ);
GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
SendClientMessage(playerid, COLOR_BASIC,"Vehicle Fliped!");
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_RED,"Cn you flip your self?");
}
return 1;
}
if (strcmp(cmdtext, "/lock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
}
}
SendClientMessage(playerid, COLOR_BASIC, "Vehicle locked!");
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1056,pX,pY,pZ);
PlayerPlaySound(playerid, 1137,pX,pY,pZ);
locked[playerid][GetPlayerVehicleID(playerid)] = 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
}
return 1;
}
if (strcmp(cmdtext, "/unlock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_RED,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
}
SendClientMessage(playerid, COLOR_BASIC, "Vehicle unlocked!");
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid, 1058,pX,pY,pZ);
locked[playerid][GetPlayerVehicleID(playerid)] = 0;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
}
return 1;
}
if (strcmp(cmdtext, "/savep", true)==0)
{
GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
GetPlayerFacingAngle(playerid, PosA[playerid]);
SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp");
PosI[playerid] = (GetPlayerInterior(playerid));
PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
return 1;
}
if (strcmp(cmdtext, "/loadp", true)==0)
{
if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
}
else
{
ResetPlayerWeapons(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), PosI[playerid]);
}
else
{
InCar[playerid] = false;
SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
SetPlayerFacingAngle(playerid, PosA[playerid]);
SetCameraBehindPlayer(playerid);
}
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
SetPlayerInterior(playerid, PosI[playerid]);
SendClientMessage(playerid, COLOR_BASIC, "Position Loaded");
}
return 1;
}
return 0;
}