Why not just do this:
Code:
new Float:hitOrigin[3]
get_hitplace_origin(victim,hitplace, hitOrigin)
Code:
stock get_hitplace_origin(id,hitplace,Float:origin[3])
{
new Float:angles[3]
switch(hitplace)
{
case HIT_HEAD: hitplace = 19
case HIT_CHEST: hitplace = 11
case HIT_LEFTARM: hitplace = 15
case HIT_RIGHTARM: hitplace = 18
case HIT_STOMACH: hitplace = 9
case HIT_GENERIC: hitplace = 10
case HIT_LEFTLEG: hitplace = 3
case HIT_RIGHTLEG: hitplace = 6
}
engfunc(EngFunc_GetBonePosition,id,hitplace,origin,angles)
}
But, I will show you how to do it your way:
When returning values from a method, the data type must be declared:
Code:
// returning ints
get_int()
{
return 1;
}
// returning floats
Float:get_float()
{
return 1.0;
}
// returning booleans
bool:get_bool()
{
return true;
}
// IMPORTANT NOTE!: When returning an array, the receiving and sending arrayss must be the same cell size.
// returning strings
new mystring[20];
mystring = get_string();
//..
get_string()
{
return "some stuff";
// or
new string[20];
// format string
return string;
}
// Invalid:
new mystring[2];
mystring = get_string();
//..
get_string()
{
new string[20];
//..
return string;
}
// Also invalid:
new mystring[40];
mystring = get_string();
//..
get_string()
{
new string[20];
//..
return string;
}
// and you can continue for other data types
__________________