Raised This Month: $51 Target: $400
 12% 

Solved Teleport player to given coordinates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Crazymonkey
Junior Member
Join Date: Jul 2015
Location: In my sloppy code.
Old 09-17-2018 , 01:14   Teleport player to given coordinates
Reply With Quote #1

Hey I've been trying to make a simple plugin that teleports players to a set of coordinates after using, and I've ran into an issue : "(35) : error 047: array sizes do not match, or destination array is too small"
PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "crazy"
#define PLUGIN_VERSION "0.00"

#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>
//#include <sdkhooks>

public Plugin myinfo 
{
    
name "event teleport",
    
author PLUGIN_AUTHOR,
    
description "teleport",
    
version PLUGIN_VERSION,
    
url "sun"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_tele_event"Cmd_EventRoomADMFLAG_GENERIC);
}

public 
Action Cmd_EventRoom(clientargs)
{
    
char eventRoom[37];
    
eventRoom "-5179.598633 3668.097900 -1640.649414";

    if (
IsPlayerAlive(client))
    {
            
TeleportEntity(clienteventRoomNULL_VECTORNULL_VECTOR); //error here
    
}
    else
    {
        
EmitSoundToClient(client"buttons/button8.wav");
        
PrintToChat(client"Must Be Alive");
    }


Last edited by Crazymonkey; 09-17-2018 at 23:42.
Crazymonkey is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 09-17-2018 , 02:21   Re: Teleport player to given coordinates
Reply With Quote #2

That's because you're passing a string through TeleportEntity()'s second param. It should be a float.

PHP Code:
float flEventRoom[3] = {-5179.5986333668.097900, -1640.649414};
TeleportEntity(clientflEventRoomNULL_VECTORNULL_VECTOR); 
__________________
Psyk0tik is offline
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 15:29.


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