Alap parancsok egy Dm/Pk/Fun/Race szerverhez, amik fontosak abban
Gyakorolgatom a scriptelést régóta már, de ez még a kezdõ scriptem volt, és most ezt megosztom veletek, hátha valaki hasznára vállik
Letöltés: http://www.solidfiles.com/d/7c093dfe2e/ #include <a_samp>
//-----------------------------------
new PlayerTimer[MAX_PLAYERS];
new PlayerTime[MAX_PLAYERS];
forward timer(playerid);
public timer(playerid)
{
if(PlayerTime[playerid] == 5) GameTextForAll(\"~b~5\",1000,3);
else if(PlayerTime[playerid] == 4) GameTextForAll(\"~g~4\",1000,3);
else if(PlayerTime[playerid] == 3) GameTextForAll(\"~r~3\",1000,3);
else if(PlayerTime[playerid] == 2) GameTextForAll(\"~w~2\",1000,3);
else if(PlayerTime[playerid] == 1) GameTextForAll(\"~y~1\",1000,3);
else if(PlayerTime[playerid] == 0)
{
GameTextForAll(\"~r~GO! ~w~GO! ~g~GO!\",3000,3);
KillTimer(PlayerTimer[playerid]);
}
PlayerTime[playerid]--;
}
//-------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, \"/pc\", true) == 0)
{
GivePlayerWeapon(playerid, 46, 1);
SendClientMessage(playerid, 0x00BFFFFF, \"Kaptál egy ejtõernyõt\");
return 1;
}
if(!strcmp(cmdtext, \"/afk\", true, 3))
{
SetPlayerPos(playerid, 1451.7942,-1068.6753,213.551);
TogglePlayerControllable(playerid, false );
SendClientMessage(playerid, 0xAFAFAFFF, \"AfK-ba léptél. Visszalépéshez /vissza\");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), \"[AFK] %s elment a géptõl\", str, cmdtext);
SendClientMessageToAll(0x33AA33FF, str);
return 1;
}
if(!strcmp(cmdtext, \"/vissza\", true, 3))
{
SpawnPlayer(playerid);
TogglePlayerControllable(playerid, true );
SendClientMessage(playerid, 0xAFAFAFFF, \"Visszatértél a játékba\");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), \"[AFK] %s visszajött a géphez\", str, cmdtext);
SendClientMessageToAll(0x33AA33FF, str);
return 1;
}
if(strcmp(cmdtext, \"/kill\", true) == 0)
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, 0xAFAFAFFF, \"Megölted Magad\");
return 1;
}
if(!strcmp(cmdtext, \"/me\", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, \"Használd: /me [cselekvés]\");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), \"* %s %s\", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
if(strcmp(cmdtext, \"/setskin\", true, 11) == 0)
{
new string[128], skinid;
if(!cmdtext[11]) return SendClientMessage(playerid, 0xAA3333AA, \"Használd: /setskin [skinID]\");
skinid = strval(cmdtext[12]);
switch(skinid)
{
case 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289: { return SendClientMessage(playerid, 0xAA3333AA, \"HIBA: Ismeretlen Skin ID.\"); }
default:
{
if(GetPlayerMoney(playerid) < 300)
{
return SendClientMessage(playerid,0xFF6600FF,\"Nincs 300$-od az új skinedhez!\");
}
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), \"A skinedet átállítottad.Az új skined: %d\", skinid);
SendClientMessage(playerid, 0xFF9933AA, string);
GivePlayerMoney(playerid,-300);
}
}
return 1;
}
if (strcmp(\"/counter\", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) < 100) { return SendClientMessage(playerid,0xFF6600FF,\"Nem tudod elindítani a visszaszámlálást, mert nincs 100$-od!\"); }
PlayerTime[playerid] = 5;
PlayerTimer[playerid] = SetTimerEx(\"timer\", 1000, true, \"i\", playerid);
SendClientMessage(playerid, 0x00BFFFFF, \"Visszaszámlálás elindítva\");
new pName[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"%s elindította a visszaszámlálást (/counter)($100)\", pName);
SendClientMessageToAll(0xFFFF00FF, string);
GivePlayerMoney(playerid, -100);
return 1;
}
if (strcmp(\"/nrg\", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFB0000FF, \"HIBA: te már jármuben vagy!\");
new Float:x,Float:y,Float:z,Float:c;
GetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid, 0x00BFFFFF, \"Lehívtál egy nrg500-t!\");
CreateVehicle(522,x+1,y+1,z,c,-1,-1,300);
return 1;
}
return SendClientMessage(playerid,0x74E80099,\"Nincs ilyen parancs!\");
}