01.07.2009, 03:15
Hey guys. I was trying to put a few codes into my gamemode but they keep giving errors. and i cant fix these stupid errors... can someone successfully put in these codes into the gamemode.... plz thanks
my gamemode==== http://pastebin.com/d29abc786
the codes:
1)anti team kill code
//ANTI TEAMKILL
public OnGameModeInit()
{
SetTimer("UpdateTeams", 1000, 1);
return 1;
}
forward UpdateTeams();
public UpdateTeams()
{
for(new i = 0; i<GetMaxPlayers(); i++)
{
if(gTeam[i] == 1) { SetPlayerTeam(playerid, 1); }
else if(gTeam[i] == 2) { SetPlayerTeam(playerid, 2); }
}
}
__________________________________________________ ___________________________
2) when person logs on/ logs off u get his ip
https://sampwiki.blast.hk/wiki/GetPlayerIp This...
or
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);
//Bottom of your script
public SettingPlayerTeam()
{
for(new playerid; playerid < 200; playerid++)
SetPlayerTeam(playerid, gTeam[playerid]);
return 1;
}
if anyone could help i would be greatly appriciated.. thanks ppl
my gamemode==== http://pastebin.com/d29abc786
the codes:
1)anti team kill code
//ANTI TEAMKILL
public OnGameModeInit()
{
SetTimer("UpdateTeams", 1000, 1);
return 1;
}
forward UpdateTeams();
public UpdateTeams()
{
for(new i = 0; i<GetMaxPlayers(); i++)
{
if(gTeam[i] == 1) { SetPlayerTeam(playerid, 1); }
else if(gTeam[i] == 2) { SetPlayerTeam(playerid, 2); }
}
}
__________________________________________________ ___________________________
2) when person logs on/ logs off u get his ip
https://sampwiki.blast.hk/wiki/GetPlayerIp This...
or
// top of your gamemode
forward SettingPlayerTeam();
//OnPlayerConnect
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);
//Bottom of your script
public SettingPlayerTeam()
{
for(new playerid; playerid < 200; playerid++)
SetPlayerTeam(playerid, gTeam[playerid]);
return 1;
}
if anyone could help i would be greatly appriciated.. thanks ppl