PDA

View Full Version : [HELP] Testing Gamemode


Eiy Mard
14/06/2012, 05:03 PM
hey i have the stupid brain .. i following the tutorial making this gamemode .. but's its not working .... please help in this
gamemode .... pastebin : http://pastebin.com/5Vh9HhNx .. fix it .. i will know what's a wrong in my gamemode ....

Infinity90
14/06/2012, 05:17 PM
You need to tell us what happens before anyone will fix it for you. You have not explained the problem.

Faisal_khan
15/06/2012, 03:17 AM
Fixed it pal:// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
// im following the tutorial .. but not work ...

#include <a_samp>

#define Criminals 1
#define Cops 2

#define CriminalsColor 0xFF0000AA
#define CopsColor 0x0015FFAA

new Float:CopRandomSpawns[4][3] = {
{2494.8743,-1686.0897,13.5129},
{2514.5706,-1672.4789,13.6054},
{2487.3936,-1648.9874,13.6405},
{2459.4307,-1689.4059,13.5369}
};


new Float:CriminalRandomSpawns[4][3] = {
{2140.0620,-1699.6169,15.0784},
{2166.7761,-1672.4318,15.0752},
{2163.2312,-1659.7107,15.0859},
{2173.2839,-1702.9806,14.3778}
};

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(1, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0:
{
SetPlayerTeam(playerid, Cops);
GameTextForPlayer(playerid, "~b~Cops", 1000, 3);
}

case 1:
{
SetPlayerTeam(playerid, Criminals);
GameTextForPlayer(playerid, "~r~Criminals", 1000, 3);
}
}
if(GetPlayerTeam(playerid) == Cops)
{
SetPlayerColor(playerid, CopsColor);
}
else if(GetPlayerTeam(playerid) ==Criminals)
{
SetPlayerColor(playerid, CriminalsColor);
}
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;
}

forward SetPlayerRandomCopSpawn(playerid);
public SetPlayerRandomCopSpawn(playerid)
{
new rand = random(sizeof(CopRandomSpawns));
SetPlayerPos(playerid, CopRandomSpawns[rand][0], CopRandomSpawns[rand][1], CopRandomSpawns[rand][2]);
return 1;
}

forward SetPlayerRandomCriminalSpawn(playerid);
public SetPlayerRandomCriminalSpawn(playerid)
{
new rand = random(sizeof(CriminalRandomSpawns));
SetPlayerPos(playerid, CriminalRandomSpawns[rand][0], CriminalRandomSpawns[rand][1], CriminalRandomSpawns[rand][2]);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
if(GetPlayerTeam(playerid) == Cops)
{
SetPlayerColor(playerid, CopsColor);
SetPlayerRandomCopSpawn(playerid);

}
else if(GetPlayerTeam(playerid) ==Criminals)
{
SetPlayerColor(playerid, CriminalsColor);
SetPlayerRandomCriminalSpawn(playerid);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
if(text[0] == '!')
{
new string[128]; GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]);
printf("%s", string);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}

return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Eiy Mard
15/06/2012, 05:28 AM
ty Faisal_Khan .. rep+ for you .. i mean put the script to the correct place ... :D