i have try this :
PHP Code:
public Action:commandprop(client, args)
{
if(args < 1)
{
ReplyToCommand(client, "Please enter a model name");
return Plugin_Handled;
}
new String:arg1[150];
GetCmdArg(1, arg1, sizeof(arg1));
new EntIndex = CreateEntityByName("prop_dynamic");
if(EntIndex != -1 && IsValidEntity(EntIndex))
{
new Float:origin[3];
GetClientAbsOrigin(client, origin);
DispatchKeyValueFloat(EntIndex, "solid", 2.0);
DispatchKeyValue(EntIndex, "model",arg1);
DispatchSpawn(EntIndex);
/*
* origin[0] = x;
* origin[1] = y;
* origin[2] = z;
*/
origin[0] += 30.0;
TeleportEntity(EntIndex, origin, NULL_VECTOR, NULL_VECTOR);
} else {
ReplyToCommand(client, "Cannot create entity!");
}
return Plugin_Handled;
}
the enity is create but it's an error
the model is precached , i test with this "models/props_combine/combine_monitor"
solved ! thx for all explication ;)