Posts: 175
Threads: 30
Joined: Jun 2010
Reputation:
0
Can I see your function textdrawkiller?
Posts: 223
Threads: 50
Joined: Jan 2013
Reputation:
0
textdrawkiller has no function o.o
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
1. 'aaa' and 'Textdraw0' are TERRIBLE variable names.
2. SetTimerEx should be used if an argument (playerid) needs to be passed.
3. Why do you hide the TD then show it again?
4. You're killing a timer without knowing if it's running. If the ID is unassigned you will kill timer ID 0, which is usually your 'main' script timer.
5. You don't need a 128-char array for a string that'll only ever be 52 (28+24) characters long.
6. You don't check whether 'killerid' is a valid player ID (if(killerid != INVALID_PLAYER_ID))before taking action on it (which can cause array index out of bound issues which will crash your script).
7. You shouldn't return anything like that. If you put code under it it'll never be called. You'll come back later and post a new topic here saying 'why him not werks?'.
8. You shouldn't really use a timer. You should destroy/hide it when the player re-spawns (OnPlayerSpawn)
9. Why are you showing/hiding the textdraw to ALL players, if it's only meant to be informing one player about their killing spree..?
10. The spacing in your if() statements could be better. It's not readable at a glance: if(KillSpree[killerid] >=3) should be if(KillSpree[killerid] >= 3)
Biggest list of problems I've ever made for such short code!
EDIT: Regarding point 9 - I guess I didn't read in to the code TOO much. Looks like you're announcing it to the entire server.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Okay, I misunderstood SOME parts of this. But most of my points are still valid.
Posts: 223
Threads: 50
Joined: Jan 2013
Reputation:
0
I need a code pls :/ i don't understand anything u say :S