AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Moving player using origin data (https://forums.alliedmods.net/showthread.php?t=48265)

bloodypizza 12-08-2006 21:59

Moving player using origin data
 
1 Attachment(s)
Hi, I'm making a plugin that will allow the admin to add points that all players will be teleported to when they've spawned from death.
But I've run into some problems when I'm trying to teleport the players to a point. Instead the player gets teleported out of the map area.

Btw, I get this warning when compiling: (47): warning 213: tag mismatch.

stupok 12-09-2006 00:16

Re: Moving player using origin data
 
No more tag mismatch.
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> new changespawnmodel[33] new changespawnnumber = 0 new changespawnspawnnumber = 0 public cmd_changespawn(id) {     if(!is_user_alive(id))         return PLUGIN_HANDLED         if(changespawnnumber==32) return PLUGIN_HANDLED     changespawnnumber++     new Float: Origin[3]     entity_get_vector(id, EV_VEC_origin, Origin)         changespawnmodel[changespawnnumber] = create_entity("info_target")     if(!changespawnmodel[changespawnnumber]) {     changespawnnumber--     return PLUGIN_HANDLED     }         entity_set_string(changespawnmodel[changespawnnumber], EV_SZ_classname, "amxmodx_changespawn")     entity_set_model(changespawnmodel[changespawnnumber], "models/player/barney/barney.mdl")         entity_set_origin(changespawnmodel[changespawnnumber], Origin)         entity_set_int(changespawnmodel[changespawnnumber], EV_INT_solid, 0)     entity_set_int(changespawnmodel[changespawnnumber], EV_INT_movetype, 0)         return PLUGIN_HANDLED } public playerspawnspawn() {     if(changespawnnumber == changespawnspawnnumber)         changespawnspawnnumber = 0         changespawnspawnnumber++     if (changespawnnumber == 0)         return PLUGIN_HANDLED         new runbitch[3]                         // I THINK THE     entity_get_vector ( changespawnmodel[changespawnspawnnumber], EV_VEC_origin, Float:runbitch)// PROBLEM     set_user_origin(read_data(1), runbitch)                     // LAYS HERE (This is row 47)     return PLUGIN_CONTINUE } public plugin_init() {     register_plugin("Change Spawn Points","BETA 1","Oskar Larsson H")     register_clcmd("xx","cmd_changespawn",ADMIN_BAN,"")     register_event("ResetHUD","playerspawnspawn","be") } public plugin_precache() {     precache_model("models/player/barney/barney.mdl") } public plugin_modules() {     require_module("fun")     require_module("engine") }


All times are GMT -4. The time now is 06:48.

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