Raised This Month: $ Target: $400
 0% 

Help Please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 11-17-2007 , 20:05   Help Please
Reply With Quote #1

ok guys i want to make a plugin for someone that will give CT's a knife and T's 1 smoke and 2 flashes.

i was gonna just edit my other plugin i made for my clan
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "Surf Map Weapons"
#define VERSION "1.0"
#define AUTHOR "Reaper2331"


public plugin_init() {
   
register_plugin(PLUGINVERSIONAUTHOR)
   
   new 
mapname[32]
   
get_mapname(mapname31)
   if(
containi(mapname"surf"))
       
register_event("ResetHUD""playerSpawn""be")
}

public 
playerSpawn(id)
{
   
set_task(2.0"checkGuns"id)
}

public 
checkGuns(id)
{
   
strip_user_weapons(id)
   
give_item(id,"weapon_knife")
   
give_item(id,"weapon_deagle")
   
give_item(id,"weapon_kevlar")
   
set_user_health(id100)
   
server_cmd("say [AMXX] Surf Mode Activated you now have a Deagle and kevlar")

but i really dont know how to get a users team and how to do it.
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-17-2007 , 20:17   Re: Help Please
Reply With Quote #2

Quote:
but i really dont know how to get a users team and how to do it

get_user_team()

or

cs_get_user_team()
__________________
Arkshine is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 11-17-2007 , 20:18   Re: Help Please
Reply With Quote #3

i read the cs_get_user_team but it confuses me lol, i dont know how to do floats and stuff yet.
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-17-2007 , 20:26   Re: Help Please
Reply With Quote #4

Code:
new CsTeams:iTeam = cs_get_user_team( id ); if( iTeam == CS_TEAM_T )     //

Code:
CS_TEAM_UNASSIGNED = 0,
CS_TEAM_T = 1,
CS_TEAM_CT = 2,
CS_TEAM_SPECTATOR = 3
__________________

Last edited by Arkshine; 11-17-2007 at 20:29.
Arkshine is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 11-17-2007 , 20:34   Re: Help Please
Reply With Quote #5

k thanks
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-19-2007 , 08:07   Re: Help Please
Reply With Quote #6

#1
if( containi( mapname, "surf" ) )
will not work if the map name begins with surf. Not sure how you crazy cs people do your map names for maps like that, but something like "surf1" will not be detected. The proper way to write that line is:
if( containi( mapname, "surf" ) != -1 )


Anyway, #2,

Code:
public checkGuns(id) {    strip_user_weapons(id)    switch ( cs_get_user_team(id) )    {       case CS_TEAM_T:          give_item( id, "weapon_smoke" );          give_item( id, "weapon_flashbang" );          give_item( id, "weapon_flashbang" );          break;       case CS_TEAM_CT:          give_item( id, "weapon_knife" );          break;    } }

The weapon entity names might be different as I don't play cs. But you get the idea.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode