Код:
#include <a_samp>
#include <core>
#include <float>
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xAA3333AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF66FFAA
#pragma tabsize 0
main()
{
print("\n----------------------------------");
print(" LasVenturas Party by:ExtremePower\n");
print("----------------------------------\n");
}
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, 10000);
SetPlayerArmour(playerid, 100.0);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"**((%s))** Se prikljucio na Party Server. Dobrodosao!",pName);
SendClientMessageToAll(0x33AA33AA,string);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"**((%s))** Je napustio server. (Timed out)",name);
case 1: format(string,sizeof string,"**((%s))** Je napustio server. (Leaving)",name);
case 2: format(string,sizeof string,"**((%s))** Je napustio server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFF00AA,string);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/admins", true) == 0) {
SendClientMessage(playerid,0xFFFFFFAA," Iz puno razloga ne pokazujemo listu online admina ali zapamti, stalno smo tu!!");
return 1;
}
if(strcmp(cmd, "/pravila", true) == 0) {
SendClientMessage(playerid,0x0FF0C,"[1] Nemoj pitati da postanes admin u igri.");
SendClientMessage(playerid,0x0FF0C,"[2] Nemoj ubijati igrace tek kada se stvore u server.");
SendClientMessage(playerid,0x0FF0C,"[3] Nemoj koristiti cheatove i modove.");
SendClientMessage(playerid,0x0FF0C,"[4] Postuj admine, pomoci ce ti.");
SendClientMessage(playerid,0x0FF0C,"[5] Postuj pravila.");
SendClientMessage(playerid,0x0FF0C,"[6] Postuj odluke od admina.");
SendClientMessage(playerid,0x0FF0C,"Hvala sto igrate na LasVenturas Party serveru!");
return 1;
}
if(strcmp(cmd, "/tele", true) == 0) {
SendClientMessage(playerid,0xFFFFFFAA,"*************************");
SendClientMessage(playerid,0xFFFF00AA,"/dm");
SendClientMessage(playerid,0xFFFFFFAA,"*************************");
return 1;
}
if(strcmp(cmd, "/pomoc", true) == 0) {
SendClientMessage(playerid,0xFFFFFFAA,"Za listu komandi /komande za teleportiranje napisi /tele.");
SendClientMessage(playerid,0xFFFFFFAA,"Prije igranja procitaj /pravila.");
SendClientMessage(playerid,0xFFFFFFAA,"Za slanje privatne poruke napisi /pm.");
SendClientMessage(playerid,0xFFFFFFAA,"Za listu dostupnih animacija napisi /anims");
SendClientMessage(playerid,0xFFFFFFAA,"Hvala sto igrate na LasVenturas Party serveru!");
return 1;
}
if(strcmp(cmd, "/komande", true) == 0) {
SendClientMessage(playerid,0xFFFF00AA,"/anims /tele /admins /pravila /pm /info");
return 1;
}
if(strcmp(cmd, "/info", true) == 0) {
SendClientMessage(playerid,0xFFFFFFAA,"Owner/Vlasnik: ExtremePower");
SendClientMessage(playerid,0xFFFFFFAA,"Skripter: ExtremePower");
SendClientMessage(playerid,0xFFFFFFAA,"Skripta: Skripta pisana od 0 lines!");
SendClientMessage(playerid,0xFFFFFFAA,"Kontakt: MSN: kiki.dubrava@hotmail.com");
SendClientMessage(playerid,0xFFFFFFAA,"Xfire: dollar3tv ili Skype: dollar3tv");
SendClientMessage(playerid,0xFFFFFFAA,"Zemlja: Hrvatska");
return 1;
}
//--------Mali anti-cheat------//
if(GetPlayerPing(playerid) > 500) Kick(playerid);
if(GetPlayerWeapon(playerid)> 38) Ban(playerid);
//------Dm arena-----/
if(strcmp(cmdtext, "/dm", true) == 0)
{
GivePlayerWeapon(playerid, 26, 500);
GivePlayerWeapon(playerid, 31, 500);
SendClientMessage(playerid,0xFFFF00AA,"Dobio si M4 i shootgun zato jer si napisao /DM, sretno u borbi!");
new cartype = GetPlayerVehicleID(playerid);
SetPlayerInterior(playerid,0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetPlayerPos(playerid,1374.8513,1769.3303,10.8203);
}
else if(IsPlayerInVehicle(playerid, cartype) == 1)
{
SetVehiclePos(cartype,1374.8513,1769.3303,10.8203);
SetVehicleZAngle(cartype,30.6101);
}
else
{
SetPlayerPos(playerid,1374.8513,1769.3303,10.8203);
}
GameTextForPlayer(playerid,"dobro dosli u DM arenu",2500,3);
return 1;
}
return 0;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,349.0453,193.2271,1014.1797);
SetPlayerFacingAngle(playerid, 286.25);
SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875);
SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnGameModeInit()
{
SetGameModeText("Lv Party");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);
AddPlayerClass(83,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(84,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(131,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(171,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(287,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(227,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(264,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(256,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(19,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(18,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
AddPlayerClass(17,1320.0809,1261.2794,10.8203,0.7322,10,0,0,0,0,0);
//-----------Vozila------------//
CreateVehicle(411, 1306.538330, 1279.499146, 10.480690, 360, -1, -1, 300); // spawnpoint (1)
CreateVehicle(411, 1310.379028, 1279.728271, 10.480690, 360, -1, -1, 300); // spawnpoint (2)
CreateVehicle(411, 1313.759277, 1279.343628, 10.480690, 360, -1, -1, 300); // spawnpoint (3)
CreateVehicle(411, 1317.071655, 1279.627808, 10.480690, 360, -1, -1, 300); // spawnpoint (4)
CreateVehicle(411, 1319.883545, 1280.028076, 10.480690, 360, -1, -1, 300); // spawnpoint (5)
CreateVehicle(411, 1323.293335, 1279.864746, 10.480690, 360, -1, -1, 300); // spawnpoint (6)
CreateVehicle(411, 1326.394775, 1279.808594, 10.480691, 360, -1, -1, 300); // spawnpoint (7)
CreateVehicle(411, 1329.290894, 1279.639893, 10.480690, 360, -1, -1, 300); // spawnpoint (Cool
CreateVehicle(522,1283.534790, 1287.406250, 10.480690, 271, -1, -1, 300); // spawnpoint (9)
CreateVehicle(522, 1283.664063, 1291.661621, 10.480690, 271, -1, -1, 300); // spawnpoint (10)
CreateVehicle(522, 1283.671021, 1294.718872, 10.480690, 271, -1, -1, 300); // spawnpoint (11)
CreateVehicle(522, 1283.325195, 1297.806885, 10.480690, 282, -1, -1, 300); // spawnpoint (12)
CreateVehicle(522, 1283.798706, 1300.750000, 10.480690, 271, -1, -1, 300); // spawnpoint (13)
CreateVehicle(522, 1283.172729, 1304.852295, 10.480690, 271, -1, -1, 300); // spawnpoint (14)
CreateVehicle(522, 1283.735352, 1307.734863, 10.480690, 271, -1, -1, 300); // spawnpoint (15)
CreateVehicle(522, 1283.443726, 1310.575562, 10.480690, 271, -1, -1, 300); // spawnpoint (16)
CreateVehicle(522, 1507.142090, 1365.637939, 69.986275, 360, -1, -1, 300); // spawnpoint (17)
CreateVehicle(522, 1502.985352, 1365.784790, 69.986275, 360, -1, -1, 300); // spawnpoint (18)
CreateVehicle(522, 1498.234985, 1365.447632, 69.986275, 360, -1, -1, 300); // spawnpoint (19)
CreateVehicle(522, 1435.534912, 1413.135864, 110.558243, 271, -1, -1, 300); // spawnpoint (20)
CreateVehicle(522, 1435.550293, 1416.087036, 110.558243, 271, -1, -1, 300); // spawnpoint (21)
CreateVehicle(522, 1435.517456, 1419.401123, 110.558243, 271, -1, -1, 300); // spawnpoint (22)
CreateVehicle(522, 1482.145386, 1579.850098, 39.607594, 78, -1, -1, 300); // spawnpoint (23)
CreateVehicle(522, 1481.841553, 1576.485107, 39.607594, 89, -1, -1, 300); // spawnpoint (24)
CreateVehicle(522, 1481.552856, 1572.959961, 39.607594, 89, -1, -1, 300); // spawnpoint (25)
CreateVehicle(522, 1371.410156, 1563.417603, 39.607594, 271, -1, -1, 300); // spawnpoint (26)
CreateVehicle(522, 1368.956543, 1591.165527, 39.607594, 270, -1, -1, 300); // spawnpoint (27)
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;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "Ulazis u vozilo %i",vehicleid);
SendClientMessage(playerid, 0xFF9900AA, string);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
new string[128];
format(string, sizeof(string), "Izlazis iz vozila %i", vehicleid);
SendClientMessage(playerid, 0xFF66FFAA, string);
return 1;
}
Then you will see errors i have one tele command but when i add another then i have errors