#include <a_samp>
new TEAM_1_SCORE = 0, TEAM_2_SCORE = 0;
new gTeam[MAX_PLAYERS];
#define TEAM_1 0
#define TEAM_2 1
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
switch(gTeam[killerid])
{
case TEAM_1: TEAM_1_SCORE++;
case TEAM_2: TEAM_2_SCORE++;
default: return 1;
}
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext,"/teamscore",true))
{
new msg[128];
switch(gTeam[playerid])
{
case TEAM_1: format(msg,128,"Your Team Score: %i",TEAM_1_SCORE);
case TEAM_2: format(msg,128,"Your Team Score: %i",TEAM_2_SCORE);
default: return 1;
}
SendClientMessage(playerid,0xFF0000FF,msg);
return 1;
}
return 0;
}
#include <a_samp>
#include <gl_common>
#define FILTERSCRIPT
#define CARS "cars.ini"
new bool:ValidVeh[MAX_VEHICLES] ;
public OnFilterScriptInit()
{
LoadStaticVehiclesFromFile(CARS);
return 1;
}
public OnFilterScriptExit()
{
new fstring[288], Float:vX, Float:vY, Float:vZ, Float:vA, File:veh;
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!ValidVeh[v]) return 0;
GetVehiclePos(v, vX, vY, vZ); GetVehicleZAngle(v, vA);
format(fstring, 288, "%d, %f, %f, %f, %f, -1, -1, -1;\r\n", GetVehicleModel(v), vX, vY, vZ, vA);
veh = fopen(CARS, io_append);
fwrite(veh, fstring);
fclose(veh);
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
ValidVeh[vehicleid] = true;
return 1;
}
public OnVehicleDeath(vehicleid)
{
ValidVeh[vehicleid] = false;
return 1;
}
#include <a_samp>
new TEAM_1_SCORE = 0, TEAM_2_SCORE = 0;
new gTeam[MAX_PLAYERS];
#define TEAM_1 0
#define TEAM_2 1
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
switch(gTeam[playerid])
{
case TEAM_1: TEAM_1_SCORE++;
case TEAM_2: TEAM_2_SCORE++;
default: return 1;
}
return 1;
}
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/teamscore",true) == 0)
{
new msg[128];
switch(gTeam[playerid])
{
case TEAM_1: format(msg,128,"Your Team Score: %i",TEAM_1_SCORE);
case TEAM_2: format(msg,128,"Your Team Score: %i",TEAM_2_SCORE);
default: return 1;
}
SendClientMessage(playerid,0xFF0000FF,msg);
return 1;
}
return 0;
}
switch(gTeam[playerid])
{
case TEAM_1: TEAM_1_SCORE++;
case TEAM_2: TEAM_2_SCORE++;
default: return 1;
}
switch(gTeam[killerid])
{
case TEAM_1: TEAM_1_SCORE++;
case TEAM_2: TEAM_2_SCORE++;
default: return 1;
}
PHP код:
|