If you script well, little help
#1

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


Reply
#2

Post your errors.

EDIT: Use
Код:
pawn Код:
CODE HERE
Reply
#3

He doesn't have errors he just wants people to put it into his gm
Reply
#4

Quote:
Originally Posted by lilstuh
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
I believe not?
He needs to learn to script himself though ..
Reply
#5

I know, him he told me that's what he wanted, but I'm too lazy to post the correct code.
Reply
#6

post your errors
Reply
#7

Well, you are flooding your server?
Код:
SetTimerEx("SettingPlayerTeam",10,1,"d",playerid);

public SettingPlayerTeam()
{
  for(new playerid; playerid < 200; playerid++)
    SetPlayerTeam(playerid, gTeam[playerid]);
  return 1;
}
Did you know you are executing something 200 times every 0.001 seconds?
Reply
#8

You do that because the SetPlayerTeam function is not always synced. So setting their team every X amount of seconds will make it perfectly sycned.
Reply
#9

C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(107 ) : error 010: invalid function or declaration
C:\Documents and Settings\Desktop\SHIP\gamemodes\freighter.pwn(111) : error 001: expected token: "-identifier-", but found ";"
C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(112 ) : error 036: empty statement
C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(221 ) : error 029: invalid expression, assumed zero
C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(221 ) : warning 215: expression has no effect
C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(221 ) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(221 ) : error 029: invalid expression, assumed zero
C:\Documents and Settings\\Desktop\SHIP\gamemodes\freighter.pwn(221 ) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#10

why do you use a Timer for the Anti Teamkill.
You can use OnPlayerDeath
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)