Imi da error 035: argument type mismatch (argument 2) la el, si nu stiu de ce.. daca poate sa ma ajute cineva
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Admin Model", "1.0 cyby version", "cyby")
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
}
public plugin_precache()
{
precache_model("models/player/baby/baby.mdl");
precache_model("models/player/baby/babyT.mdl");
return 0;
}
public ResetModel(id)
{
new szSteam[32];
get_user_authid(id, szSteam, 31);
if (!is_user_alive(id) || !equali(szSteam, "STEAM_0:0:554880955"))
{
return 1;
}
new CsTeams:userTeam = cs_get_user_team(id, 0);
if (userTeam == CsTeams:1)
{
cs_set_user_model(id, "baby");
}
else
{
if (userTeam == CsTeams:2)
{
cs_set_user_model(id, "baby");
}
cs_reset_user_model(id);
}
client_cmd(id, "cl_minmodels 0");
return 1;
}
error 035: argument type mismatch (argument 2)
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
-
- Membru, skill 0
- Posts: 15
- Joined: 07 May 2021, 02:23
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0
-
- Membru, skill +1
- Posts: 349
- Joined: 26 Jan 2020, 18:52
- Detinator Steam: Da
- CS Status: 0x416469
- SteamID: shadowsadi120
- Fond eXtream: 0
- Has thanked: 14 times
- Been thanked: 50 times
Si linia unde este eroarea?
Edit:
Edit:
Code: Select all
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Admin Model", "1.0 cyby version", "cyby")
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
}
public plugin_precache()
{
precache_model("models/player/baby/baby.mdl");
precache_model("models/player/baby/babyT.mdl");
}
public ResetModel(id)
{
new szSteam[32];
get_user_authid(id, szSteam, 31);
if (!is_user_alive(id) || !equali(szSteam, "STEAM_0:0:554880955"))
{
return 1;
}
new CsTeams:userTeam = cs_get_user_team(id);
if (userTeam == CS_TEAM_T)
{
cs_set_user_model(id, "baby");
}
else
{
if (userTeam == CS_TEAM_CT)
{
cs_set_user_model(id, "baby");
}
}
client_cmd(id, "cl_minmodels 0");
return 1;
}
-
- Membru, skill 0
- Posts: 15
- Joined: 07 May 2021, 02:23
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0
-
- Membru, skill +1
- Posts: 349
- Joined: 26 Jan 2020, 18:52
- Detinator Steam: Da
- CS Status: 0x416469
- SteamID: shadowsadi120
- Fond eXtream: 0
- Has thanked: 14 times
- Been thanked: 50 times
Data viitoare explica ceea ce vrei sa faci.Baby..Gril wrote: ↑07 May 2021, 08:45Tot nu merge, Vreau sa fac in asa fel sa-mi pot da skin de caracter pe steamid
Code: Select all
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Admin Model", "1.0 cyby version", "cyby")
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
}
public plugin_precache()
{
precache_model("models/player/baby/baby.mdl");
precache_model("models/player/baby/babyT.mdl");
}
public player_spawn(id) // Tu nu ai definit nicaieri funcita ResetModel(), doar player_spawn, deci foloseste-o
{
new szSteam[32];
get_user_authid(id, szSteam, 31);
if (is_user_alive(id) && equali(szSteam, "STEAM_0:0:554880955"))
{
cs_set_user_model(id, "baby");
}
return 1;
}
- levin
- Scripter eXtreamCS
- Posts: 3850
- Joined: 24 Aug 2011, 12:24
- Detinator Steam: Da
- CS Status: ♅
- Detinator server CS: ☯∴
- SteamID: 76561198063679589
- Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy - Location: ҳ̸Ҳ̸ҳ
- Discord: devilclass
- Has thanked: 36 times
- Been thanked: 595 times
- Contact:
hai că din varză, ai făcut muci
Code: Select all
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#pragma tabsize 0
//#define HARD_MODEL
//#define SUPER_HARD_MODEL
//#define REGEX_IP
#if defined HARD_MODEL
#include <cstrike>
#endif
#if defined REGEX_IP
#include <regex>
#pragma ctrlchar '#'
//https://forums.alliedmods.net/showpost.php?p=759614&postcount=24
static const g_szPattern[] = "^\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b$";
new Regex:g_hPreCompiledPattern;
#endif
enum ModelInfo{
Type[2], // S = SteamID , I = IP(no port) , N = Nick
Auth[35], // Type ARG
Team, // 1 = T , 2 = CT , 3 = T+CT
Model[25] // Simple Name of Model - to /cstrike/models/player/MODEL_NAME/MODEL_NAME.mdl
}
static const Models[][ModelInfo]={
{ "S", "STEAM_0:0:554880955", 1, "baby" }
},
PLAYERMODEL_CLASSNAME[] = "ent_playermodel"
new g_player_model[33][35]
new g_ent_playermodel[33]
public plugin_precache() for(new i; i < sizeof(Models); i++) precache_player_model(Models[i][Model])
stock precache_player_model(const szModel[]){
static szFile[128];formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)
engfunc( EngFunc_PrecacheModel, szFile )
replace(szFile, charsmax(szFile), ".mdl", "T.mdl")
if(file_exists(szFile)) engfunc( EngFunc_PrecacheModel, szFile )
}
public plugin_init(){
RegisterHam(Ham_Spawn, "player", "SPCMD", 1)
register_forward( FM_AddToFullPack, "fw_AddToFullPack" )
#if defined SUPER_HARD_MODEL
register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" )
#endif
register_message( get_user_msgid( "ClCorpse" ), "message_clcorpse" )
#if defined REGEX_IP
static Ret, szError[ 2 ];
g_hPreCompiledPattern = regex_compile ( g_szPattern, Ret, szError, charsmax ( szError ) );
#endif
}
public client_connect(id){
g_ent_playermodel[id]=0
copy(g_player_model[id],charsmax(g_player_model[]),"")
}
#if AMXX_VERSION_NUM < 183
public client_disconnect( id )
#else
public client_disconnected( id )
#endif
{
if ( fm_has_custom_model( id ) ) fm_remove_model_ent( id )
}
public SPCMD(id){
if(!get_user_team(id)) return
if(!is_user_alive(id)) return
if(!CheckIndexMV(id)) return
if ( fm_has_custom_model( id ) ) fm_remove_model_ent( id )
for(new i; i < sizeof(Models); i++){
switch(Models[i][Team]){
case 1,2:{
if(Models[i][Team]==get_user_team(id)){
#if defined HARD_MODEL
#if AMXX_VERSION_NUM < 183
cs_set_user_model(id, Models[i][Model])
#else
cs_set_user_model(id, Models[i][Model],true)
#endif
#endif
copy( g_player_model[id], charsmax( g_player_model[] ),Models[i][Model] )
}
}
case 3:{
#if defined HARD_MODEL
#if AMXX_VERSION_NUM < 183
cs_set_user_model(id, Models[i][Model])
#else
cs_set_user_model(id, Models[i][Model],true)
#endif
#endif
copy( g_player_model[id], charsmax( g_player_model[] ),Models[i][Model] )
}
}
}
fm_set_playermodel_ent( id, g_player_model[id] )
}
public fw_AddToFullPack( es, e, ent, host, hostflags, player ){
if ( player ) return FMRES_IGNORED;
if ( ent == g_ent_playermodel[host] ) return FMRES_SUPERCEDE;
return FMRES_IGNORED;
}
public message_clcorpse(){
static id;id = get_msg_arg_int( 12 )
if(!is_user_connected(id)) return
if ( fm_has_custom_model( id ) ) set_msg_arg_string( 1, g_player_model[id] )
}
stock fm_set_playermodel_ent( const id, const modelname[] ){
if(!is_user_alive(id)) return
set_pev( id, pev_rendermode, kRenderTransTexture )
set_pev( id, pev_renderamt, 1.0 )
static modelpath[128];formatex( modelpath, charsmax( modelpath ), "models/player/%s/%s.mdl", modelname, modelname )
if ( !pev_valid( g_ent_playermodel[id] ) ){
g_ent_playermodel[id] = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) )
if ( !pev_valid( g_ent_playermodel[id] ) ) return;
set_pev( g_ent_playermodel[id], pev_classname, PLAYERMODEL_CLASSNAME )
set_pev( g_ent_playermodel[id], pev_movetype, MOVETYPE_FOLLOW )
set_pev( g_ent_playermodel[id], pev_aiment, id )
set_pev( g_ent_playermodel[id], pev_owner, id )
}
engfunc( EngFunc_SetModel, g_ent_playermodel[id], modelpath )
#if defined SUPER_HARD_MODEL
engfunc(EngFunc_SetClientKeyValue, id, engfunc(EngFunc_GetInfoKeyBuffer, id), "model", modelname)
#endif
}
#if defined SUPER_HARD_MODEL
public fw_SetClientKeyValue( id, const infobuffer[], const key[] ){
if ( fm_has_custom_model(id) && equali( key, "model" ) ){
static currentmodel[35];fm_get_user_model( id, currentmodel, charsmax( currentmodel ) )
if ( !equal( currentmodel, g_player_model[id] ) ) fm_set_playermodel_ent( id, g_player_model[id] )
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
stock fm_get_user_model(player, model[], len) engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
#endif
stock bool:fm_has_custom_model( const id ) return pev_valid( g_ent_playermodel[id] ) ? true : false;
stock fm_remove_model_ent( const id ){
set_pev( id, pev_rendermode, kRenderNormal )
if ( pev_valid( g_ent_playermodel[id] ) ){
engfunc( EngFunc_RemoveEntity, g_ent_playermodel[id] )
g_ent_playermodel[id] = 0
copy(g_player_model[id],charsmax(g_player_model[]),"")
}
#if defined SUPER_HARD_MODEL
dllfunc(DLLFunc_ClientUserInfoChanged, id, engfunc(EngFunc_GetInfoKeyBuffer, id))
#endif
}
stock bool:CheckIndexMV(const id){
static auth[35];
for(new i; i < sizeof(Models); i++){
if(Models[i][Type]=='S'&&containi(Models[i][Auth],"STEAM_0:")!=-1&&!IsValidIP(Models[i][Auth])){
get_user_authid(id, auth, charsmax(auth))
if(equali(auth,Models[i][Auth])) return true
}
else if(Models[i][Type]=='I'&&IsValidIP(Models[i][Auth])){
get_user_ip(id, auth, charsmax(auth),1)
if(equali(auth,Models[i][Auth])) return true
}
else if(Models[i][Type]=='N'){
get_user_name(id, auth, charsmax(auth))
if(equal(auth,Models[i][Auth])) return true
}
}
return false
}
stock bool:IsValidIP(const arg[]){
#if !defined REGEX_IP
static temp[64];
new len = copy(temp, charsmax(temp), arg);
new sections;
for( new i = 0; i < len; i++ ){
switch( temp[i] ){
case '.': sections++;
//case ':': { }
//case '0' .. '9': { }
default: return false;
}
}
return (sections == 3)?true:false;
#else
static Ret;
return regex_match_c ( arg, g_hPreCompiledPattern, Ret ) > 0?true:false;
#endif
}
Nu îmi mai trimiteți PM pe forum! Nu merge să răspund
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
-
- Membru, skill +1
- Posts: 349
- Joined: 26 Jan 2020, 18:52
- Detinator Steam: Da
- CS Status: 0x416469
- SteamID: shadowsadi120
- Fond eXtream: 0
- Has thanked: 14 times
- Been thanked: 50 times
Adica?L E V I N wrote: ↑07 May 2021, 16:12hai că din varză, ai făcut muciCode: Select all
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #pragma tabsize 0 //#define HARD_MODEL //#define SUPER_HARD_MODEL //#define REGEX_IP #if defined HARD_MODEL #include <cstrike> #endif #if defined HARD_MODEL #include <cstrike> #endif #if defined REGEX_IP #include <regex> #pragma ctrlchar '#' //https://forums.alliedmods.net/showpost.php?p=759614&postcount=24 static const g_szPattern[] = "^\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b$"; new Regex:g_hPreCompiledPattern; #endif enum ModelInfo{ Type[2], // S = SteamID , I = IP(no port) , N = Nick Auth[35], // Type ARG Team, // 1 = T , 2 = CT , 3 = T+CT Model[25] // Simple Name of Model - to /cstrike/models/player/MODEL_NAME/MODEL_NAME.mdl } static const Models[][ModelInfo]={ { "S", "STEAM_0:0:554880955", 1, "baby" } }, PLAYERMODEL_CLASSNAME[] = "ent_playermodel" new g_player_model[33][35] new g_ent_playermodel[33] public plugin_precache() for(new i; i < sizeof(Models); i++) precache_player_model(Models[i][Model]) stock precache_player_model(const szModel[]){ static szFile[128];formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel) engfunc( EngFunc_PrecacheModel, szFile ) replace(szFile, charsmax(szFile), ".mdl", "T.mdl") if(file_exists(szFile)) engfunc( EngFunc_PrecacheModel, szFile ) } public plugin_init(){ RegisterHam(Ham_Spawn, "player", "SPCMD", 1) register_forward( FM_AddToFullPack, "fw_AddToFullPack" ) #if defined SUPER_HARD_MODEL register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" ) #endif register_message( get_user_msgid( "ClCorpse" ), "message_clcorpse" ) #if defined REGEX_IP static Ret, szError[ 2 ]; g_hPreCompiledPattern = regex_compile ( g_szPattern, Ret, szError, charsmax ( szError ) ); #endif } public client_connect(id){ g_ent_playermodel[id]=0 copy(g_player_model[id],charsmax(g_player_model[]),"") } #if AMXX_VERSION_NUM < 183 public client_disconnect( id ) #else public client_disconnected( id ) #endif { if ( fm_has_custom_model( id ) ) fm_remove_model_ent( id ) } public SPCMD(id){ if(!get_user_team(id)) return if(!is_user_alive(id)) return if(!CheckIndexMV(id)) return if ( fm_has_custom_model( id ) ) fm_remove_model_ent( id ) for(new i; i < sizeof(Models); i++){ switch(Models[i][Team]){ case 1,2:{ if(Models[i][Team]==get_user_team(id)){ #if defined HARD_MODEL #if AMXX_VERSION_NUM < 183 cs_set_user_model(id, Models[i][Model]) #else cs_set_user_model(id, Models[i][Model],true) #endif #endif copy( g_player_model[id], charsmax( g_player_model[] ),Models[i][Model] ) } } case 3:{ #if defined HARD_MODEL #if AMXX_VERSION_NUM < 183 cs_set_user_model(id, Models[i][Model]) #else cs_set_user_model(id, Models[i][Model],true) #endif #endif copy( g_player_model[id], charsmax( g_player_model[] ),Models[i][Model] ) } } } fm_set_playermodel_ent( id, g_player_model[id] ) } public fw_AddToFullPack( es, e, ent, host, hostflags, player ){ if ( player ) return FMRES_IGNORED; if ( ent == g_ent_playermodel[host] ) return FMRES_SUPERCEDE; return FMRES_IGNORED; } public message_clcorpse(){ static id;id = get_msg_arg_int( 12 ) if(!is_user_connected(id)) return if ( fm_has_custom_model( id ) ) set_msg_arg_string( 1, g_player_model[id] ) } stock fm_set_playermodel_ent( const id, const modelname[] ){ if(!is_user_alive(id)) return set_pev( id, pev_rendermode, kRenderTransTexture ) set_pev( id, pev_renderamt, 1.0 ) static modelpath[128];formatex( modelpath, charsmax( modelpath ), "models/player/%s/%s.mdl", modelname, modelname ) if ( !pev_valid( g_ent_playermodel[id] ) ){ g_ent_playermodel[id] = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) ) if ( !pev_valid( g_ent_playermodel[id] ) ) return; set_pev( g_ent_playermodel[id], pev_classname, PLAYERMODEL_CLASSNAME ) set_pev( g_ent_playermodel[id], pev_movetype, MOVETYPE_FOLLOW ) set_pev( g_ent_playermodel[id], pev_aiment, id ) set_pev( g_ent_playermodel[id], pev_owner, id ) } engfunc( EngFunc_SetModel, g_ent_playermodel[id], modelpath ) #if defined SUPER_HARD_MODEL engfunc(EngFunc_SetClientKeyValue, id, engfunc(EngFunc_GetInfoKeyBuffer, id), "model", modelname) #endif } #if defined SUPER_HARD_MODEL public fw_SetClientKeyValue( id, const infobuffer[], const key[] ){ if ( fm_has_custom_model(id) && equali( key, "model" ) ){ static currentmodel[35];fm_get_user_model( id, currentmodel, charsmax( currentmodel ) ) if ( !equal( currentmodel, g_player_model[id] ) ) fm_set_playermodel_ent( id, g_player_model[id] ) return FMRES_SUPERCEDE; } return FMRES_IGNORED; } stock fm_get_user_model(player, model[], len) engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len) #endif stock bool:fm_has_custom_model( const id ) return pev_valid( g_ent_playermodel[id] ) ? true : false; stock fm_remove_model_ent( const id ){ set_pev( id, pev_rendermode, kRenderNormal ) if ( pev_valid( g_ent_playermodel[id] ) ){ engfunc( EngFunc_RemoveEntity, g_ent_playermodel[id] ) g_ent_playermodel[id] = 0 copy(g_player_model[id],charsmax(g_player_model[]),"") } #if defined SUPER_HARD_MODEL dllfunc(DLLFunc_ClientUserInfoChanged, id, engfunc(EngFunc_GetInfoKeyBuffer, id)) #endif } stock bool:CheckIndexMV(const id){ static auth[35]; for(new i; i < sizeof(Models); i++){ if(Models[i][Type]=='S'&&containi(Models[i][Auth],"STEAM_0:")!=-1&&!IsValidIP(Models[i][Auth])){ get_user_authid(id, auth, charsmax(auth)) if(equali(auth,Models[i][Auth])) return true } else if(Models[i][Type]=='I'&&IsValidIP(Models[i][Auth])){ get_user_ip(id, auth, charsmax(auth),1) if(equali(auth,Models[i][Auth])) return true } else if(Models[i][Type]=='N'){ get_user_name(id, auth, charsmax(auth)) if(equal(auth,Models[i][Auth])) return true } } return false } stock bool:IsValidIP(const arg[]){ #if !defined REGEX_IP static temp[64]; new len = copy(temp, charsmax(temp), arg); new sections; for( new i = 0; i < len; i++ ){ switch( temp[i] ){ case '.': sections++; //case ':': { } //case '0' .. '9': { } default: return false; } } return (sections == 3)?true:false; #else static Ret; return regex_match_c ( arg, g_hPreCompiledPattern, Ret ) > 0?true:false; #endif }
De ce ai creat o noua entitate care sa urmeze jucatorul respectiv?
De ce i-ai facut setare dupa nume / IP daca in cerere scrie ca doreste pe steamID?
De ce nu folosesti doar fakemeta in cod?
Iar codul dat de mine, din perspectiva ta, de ce nu ar functiona? Este mult mai putin performant codul? Explica.
Last edited by levin on 07 May 2021, 20:57, edited 1 time in total.
Reason: :)))
Reason: :)))
-
- Membru, skill 0
- Posts: 15
- Joined: 07 May 2021, 02:23
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0