AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MULTI set_user_origin (https://forums.alliedmods.net/showthread.php?t=131549)

Ex3cuTioN 07-06-2010 11:04

MULTI set_user_origin
 
I have a problem...a big one :D

When i type in chat /start i want 5 T and 5 CT to teleport at the coordonates below.

PHP Code:

new T1[3] = { -240, -150, -91 }
new 
T2[3] = { -240, -230, -91 }
new 
T3[3] = { -240, -330, -91 }
new 
T4[3] = { -240, -430, -91 }
new 
T5[3] = { -240, -530, -91 }

new 
CT1[3] = { 350, -150, -91 }
new 
CT2[3] = { 350, -230, -91 }
new 
CT3[3] = { 350, -330, -91 }
new 
CT4[3] = { 350, -430, -91 }
new 
CT5[3] = { 350, -530, -91 

PHP Code:

public KnifeDuel()
{
    new 
players[32], num,i;
    
    
get_players(playersnum);
    
    for (
i=0i<numi++)
    {
        if(
get_user_team(players[i]) == 1)
        {
            
set_user_origin(players[i],T1);
            
cs_reset_user_model(players[i]);
            
fm_strip_user_weapons(players[i]);
            
fm_give_item(players[i],"weapon_knife");//real
        
}
        
        else if(
get_user_team(players[i]) == 2)
        {
            
set_user_origin(players[i], CT1);
            
cs_reset_user_model(players[i]);
            
fm_strip_user_weapons(players[i]);
            
fm_give_item(players[i],"weapon_knife");//real
        
}
    }


You must understand the situation very easy...

abdul-rehman 07-06-2010 11:26

Re: MULTI set_user_origin
 
Quote:

Originally Posted by Ex3cuTioN (Post 1229853)
I have a problem...a big one :D

When i type in chat /start i want 5 T and 5 CT to teleport at the coordonates below.

Code:
new T1[3] = { -240, -150, -91 } new T2[3] = { -240, -230, -91 } new T3[3] = { -240, -330, -91 } new T4[3] = { -240, -430, -91 } new T5[3] = { -240, -530, -91 }   new CT1[3] = { 350, -150, -91 } new CT2[3] = { 350, -230, -91 } new CT3[3] = { 350, -330, -91 } new CT4[3] = { 350, -430, -91 } new CT5[3] = { 350, -530, -91 }

Code:
public KnifeDuel() {     new players[32], num,i;       get_players(players, num);       for (i=0; i<num; i++)     {         if(get_user_team(players[i]) == 1)         {             set_user_origin(players[i],T1);             cs_reset_user_model(players[i]);             fm_strip_user_weapons(players[i]);             fm_give_item(players[i],"weapon_knife");//real         }           else if(get_user_team(players[i]) == 2)         {             set_user_origin(players[i], CT1);             cs_reset_user_model(players[i]);             fm_strip_user_weapons(players[i]);             fm_give_item(players[i],"weapon_knife");//real         }     } }

You must understand the situation very easy...

So whats the problem then...??
You didnt explain it above...!

drekes 07-06-2010 11:29

Re: MULTI set_user_origin
 
PHP Code:

public KnifeDuel()
{
    new 
players[32], numitempid;
    
    
get_players(playersnum);
    
    for (
i=0i<numi++)
    {
        
tempid players[i];
        
        if(
get_user_team(tempid) == 1)
        {
            
set_user_origin(tempid,T1);
            
cs_reset_user_model(tempid);
            
fm_strip_user_weapons(tempid);
            
fm_give_item(tempid,"weapon_knife");//real
        
}
        
        else if(
get_user_team(tempid) == 2)
        {
            
set_user_origin(tempidCT1);
            
cs_reset_user_model(tempid);
            
fm_strip_user_weapons(tempid);
            
fm_give_item(tempid,"weapon_knife");//real
        
}
    }


Try this, and i think it's better to use strip_user_weapons and give_item from the fun module

Ex3cuTioN 07-06-2010 11:42

Re: MULTI set_user_origin
 
Let me explain to you :D

PHP Code:

new T1[3] = { -240, -150, -91 // for 1 T player
new T2[3] = { -240, -230, -91 // for another one
new T3[3] = { -240, -330, -91 // for another one
new T4[3] = { -240, -430, -91 // for another one
new T5[3] = { -240, -530, -91 // for another one
 
new CT1[3] = { 350, -150, -91 // for 1 CT player
new CT2[3] = { 350, -230, -91 // for another one CT
new CT3[3] = { 350, -330, -91 // for another one CT 
new CT4[3] = { 350, -430, -91 // for another one CT 
new CT5[3] = { 350, -530, -91 // for another one CT 

I mean set_user_origin(tempid,T1); that T1 makes all the players from the 'for' that are T to teleport in the same place...and the story is same with CT's...

Alucard^ 07-06-2010 11:43

Re: MULTI set_user_origin
 
Should something like this:

Code:
new const Float:TerroristOrigins[5][3] = {     {-240, -150, -91},     {-240, -230, -91},     {-240, -330, -91},     {-240, -430, -91},     {-240, -530, -91} } new const Float:CounterOrigins[5][3] = {     {350, -150, -91},     {350, -230, -91},     {350, -330, -91},     {350, -430, -91},     {350, -530, -91} } public KnifeDuel() {     new players[32], num, tt, ct, id;         get_players(players, num);         for(new i = 0; i < num; i++)     {         id = players[i];                 if(cs_get_user_team(id) == CS_TEAM_T)         {             if(tt > 5) return;                         set_pev(id, pev_origin, TerroristOrigins[tt]);             cs_reset_user_model(id);             strip_user_weapons(id);             give_item(id, "weapon_knife");                         tt++;         }                 else if(cs_get_user_team(id) == CS_TEAM_CT)         {             if(ct > 5) return;                         set_pev(id, pev_origin, CounterOrigins[ct]);             cs_reset_user_model(id);             strip_user_weapons(id);             give_item(id, "weapon_knife");                         ct++;         }     } }

But for some reasons that i don't know i get tag mismatch :/

drekes 07-06-2010 11:49

Re: MULTI set_user_origin
 
Code:

const Float:TerroristOrigins[5][3] =
:arrow:
Code:


new const: TerroristOrigins[5][3] =

The data that it holds are not floats. That's why you get tag mismatch

Ex3cuTioN 07-06-2010 11:52

Re: MULTI set_user_origin
 
Thanks Alucard^ but

PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Warning
Tag mismatch on line 67
Warning
Tag mismatch on line 67
Warning
Tag mismatch on line 67
Warning
Tag mismatch on line 68
Warning
Tag mismatch on line 68
Warning
Tag mismatch on line 68
Warning
Tag mismatch on line 69
Warning
Tag mismatch on line 69
Warning
Tag mismatch on line 69
Warning
Tag mismatch on line 70
Warning
Tag mismatch on line 70
Warning
Tag mismatch on line 70
Warning
Tag mismatch on line 71
Warning
Tag mismatch on line 71
Warning
Tag mismatch on line 71
Warning
Tag mismatch on line 76
Warning
Tag mismatch on line 76
Warning
Tag mismatch on line 76
Warning
Tag mismatch on line 77
Warning
Tag mismatch on line 77
Warning
Tag mismatch on line 77
Warning
Tag mismatch on line 78
Warning
Tag mismatch on line 78
Warning
Tag mismatch on line 78
Warning
Tag mismatch on line 79
Warning
Tag mismatch on line 79
Warning
Tag mismatch on line 79
Warning
Tag mismatch on line 80
Warning
Tag mismatch on line 80
Warning
Tag mismatch on line 80
Warning
Symbol is assigned a value that is never used"gHudSyncObj" on line 1115
Warning
Symbol is assigned a value that is never used"gMsgSendAudio" on line 1115
Header size
:           2756 bytes
Code size
:            28572 bytes
Data size
:            15868 bytes
Stack
/heap size:      16384 bytesmaxusage is unknowndue to recursion
Total requirements
:   63580 bytes

32 Warnings
.
Done

And my server crash when i say /start

Thanks drekes but

PHP Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2006 ITB CompuPhaseAMX Mod X Team

Error
Invalid symbol name "" on line 69
Error
Invalid function or declaration on line 74
Error
Invalid symbol name "" on line 78
Error
Invalid function or declaration on line 83
Warning
Tag mismatch on line 763
Error
: Array sizes do not match, or destination array is too small on line 763
Warning
Tag mismatch on line 771
Error
: Array sizes do not match, or destination array is too small on line 771
Warning
Symbol is assigned a value that is never used"gHudSyncObj" on line 1121
Warning
Symbol is assigned a value that is never used"gMsgSendAudio" on line 1121

6 Errors
.
Could not locate output file I:\HLDS\cstrike\addons\amxmodx\plugins\hnswar.amx (compile failed). 


Line 69 is { -240, -150, -91 }

drekes 07-06-2010 11:53

Re: MULTI set_user_origin
 
check my previous post

Ex3cuTioN 07-06-2010 11:56

Re: MULTI set_user_origin
 
Look at my previous post :D i edited

drekes 07-06-2010 11:57

Re: MULTI set_user_origin
 
could you post the full code block like you have it now?


All times are GMT -4. The time now is 07:09.

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