Better Freecode?
Code:
//=======================================================
#include <amxmodx>
#include <fun>
//=======================================================
new bool:hashadspeed
[32]
new bool:hasnothadspeed
[32]
new times
[33] = 5
//=======================================================
/*******************************************************************
*Need For Speed: By: Dizzy
*===============
*Description - Gives You Extra Speed For Either
*5 or 10 Seconds For A Price (1 Per Round)
*
*Cvars - sv_nfs 0|1 [Off|On]
*
*Clcmds - /needspeed5 - Gives 5 Seconds Of Speed For 800 Dollars
* /needspeed10 - Gives 10 Seconds Of Speed For 1600 Dollars
* /needspeed? - Tells Client If NFS Is On Or Off
*
*Comments? - Email: <a href="mailto:[email protected]">[email protected]</a>
* AIM: AwPOAwPDiZzY
*******************************************************************/
//=======================================================
//=======================================================
public plugin_init
() {
register_plugin("Need For Speed",
".1",
"Dizzy")
register_cvar("sv_nfs",
"1")
register_clcmd("say /needspeed5",
"speed5")
register_clcmd("say /needspeed10",
"speed10")
register_clcmd("say /needspeed?",
"speed?")
register_event("ResetHUD",
"newround",
"b")
}
//=======================================================
//=======================================================
public client_connect
( id
) {
hashadspeed
[id
] = false
hasnothadspeed
[id
] = true
}
public client_disconnect
( id
) {
hashadspeed
[id
] = false
hasnothadspeed
[id
] = true
}
//=======================================================
//=======================================================
public speed5
( id
) {
if (get_cvar_num("sv_nfs")==0)
client_print(0,print_chat,
"[AMXX][Need For Speed] Is Off!")
return PLUGIN_HANDLED
}
else
{
if (hashadspeed
[id
])
client_print(0,print_chat,
"[AMXX][Need For Speed] Sorry, Try Next Round!")
return PLUGIN_CONTINUE
}
else
{
set_user_maxspeed
(id, set_user_maxspeed
(id
) + 300)
cs_set_user_money
(id, cs_get_user_money
(id
) - 800)
client_print(0,print_chat,
"[AMXX][Need For Speed] You Have Speed For 5 Seconds!")
hashadspeed
[id
] = true
hasnothadspeed
[id
] = false
return PLUGIN_HANDLED
}
//=======================================================
//=======================================================
public speed10
(id
) {
if (get_cvar_num("sv_nfs")==0)
client_print(0,print_chat,
"[AMXX][Need For Speed] Is Off!")
return PLUGIN_HANDLED
}
else
{
if (hashadspeed
[id
])
client_print(0,print_chat,
"[AMXX][Need For Speed] Sorry, Try Next Round!")
return PLUGIN_CONTINUE
}
else
{
set_user_maxspeed
(id, set_user_maxspeed
(id
) + 300)
cs_set_user_money
(id, cs_get_user_money
(id
) - 1600)
client_print(0,print_chat,
"[AMXX][Need For Speed] You Have Speed For 10 Seconds!")
hashadspeed
[id
] = true
hasnothadspeed
[id
] = false
return PLUGIN_HANDLED
}
//=======================================================
//=======================================================
public speed?
(id
) {
if (get_cvar_num("sv_nfs")==0)
client_print(0,print_chat,
"[AMXX][Need For Speed] Is Off!")
if (get_cvar_num("sv_nfs")==1)
client_print(0,print_chat,
"[AMXX][Need For Speed] Is On!")
if (hashadspeed
[id
])
client_print(0,print_chat,
"[AMXX][Need For Speed] You Have Had Speed This Round!")
if (hasnothadspeed
[id
])
client_print(0,print_chat,
"[AMXX][Need For Speed] You Have Not Had Speed This Round!")
return PLUGIN_HANDLED
}
//=======================================================
//=======================================================
public roundchange
(id
) {
hadhadspeed
[id
] = false
hasnothadspeed
[id
] = true
return PLUGIN_CONTINUE
}
//=======================================================
Could You Help With My Question Now?
__________________