Spamowaniem nazywasz wysłaniem 2 wiadomości? <lol2> Po drugie skorzystałem z kodu ortęgi:
if(player_class[id] == Nekromanta && on_knife[id] && (button2 & IN_RELOAD) && is_user_alive(id))
{
if(player_teleported[id])
hudmsg(id,2.0,"Teleportu na respa mozesz uzyc tylko raz na runde!")
else
{
player_teleported[id] = true;
set_task( 0.5, "Tspawn", id+TASK_TELEPORT);
}
}
public Tspawn( id ) {
new client = id - TASK_TELEPORT;
new CsTeams:iTeam;
iTeam = cs_get_user_team( client );
new iSpawnOrigin[3];
new Float:fSpawnAngle[3];
new ent;
ent = -1;
switch( iTeam ) {
case CS_TEAM_T:
{
while( ( ent = find_ent_by_class( ent, "info_player_deathmatch" ) ) != 0 ) {
if( !pev_valid( ent ) )
break;
}
get_user_origin( ent, iSpawnOrigin );
}
case CS_TEAM_CT:
{
while( ( ent = find_ent_by_class( ent, "info_player_start" ) ) != 0 ) {
if( !pev_valid( ent ) )
break;
}
get_user_origin( ent, iSpawnOrigin );
}
case CS_TEAM_SPECTATOR:
{
return;
}
}
if( !is_user_alive( client ) )
return;
new Float:fSpawnOrigin[3];
fSpawnOrigin[0] = iSpawnOrigin[0] + 0.0;
fSpawnOrigin[1] = iSpawnOrigin[1] + 0.0;
fSpawnOrigin[2] = iSpawnOrigin[2] + 0.0;
entity_set_vector( client, EV_VEC_origin, fSpawnOrigin );
entity_set_int( client, EV_INT_fixangle, 1 );
entity_set_vector( client, EV_VEC_angles, fSpawnAngle );
hudmsg(id,2.0,"Teleportowales sie na resp");
TeleportMSG( client );
}
TeleportMSG( client ) {
new fNewSpawnOrigin[3];
get_user_origin( client, fNewSpawnOrigin, 2 );
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, { 0, 0, 0 }, client )
write_byte( TE_TELEPORT )
write_coord( fNewSpawnOrigin[0] )
write_coord( fNewSpawnOrigin[1] )
write_coord( fNewSpawnOrigin[2] )
message_end( )
}
Dodałem nową zmienną:
new player_teleported[33]
Oraz do public roundstart():
player_teleported[i] = false
I nie działa mi to

Gdy chce użyć teleportu cały czas wyskakuje mi informacja
"Teleportu możesz użyć raz na runde!" Nie wiecie czemu tak jest?
Użytkownik slowly edytował ten post 27.08.2010 12:34