Raised This Month: $ Target: $400
 0% 

Entities are not spawning!!!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 01-29-2005 , 17:41   Entities are not spawning!!!!!
Reply With Quote #1

Whats wrong with this code?
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> new fakecivX[14] = (2959,2753,2129,2129,2129,2006,1064,65,65,-1633,-1633,-2256,-2221,-1568) new fakecivY[14] = (-515,72,120,120,120,-1849,-2220,-1655,-1655,-89,-89,-1577,-2036,-1431) new fakecivZ[14] = (-284,-264,-252,-252,-252,-172,-252,-284,-284,-268,-268,-292,-236,-284) new fakecivvoice[14] = (1,1,1,2,2,1,2,1,2,2,2,1,1,1) new fakeciv[14] new fakecivnames[14] public plugin_init() {     register_plugin("FakeCiv","0.1","-Snort- Leader")     register_clcmd("spawncivs","spawnfakecivs") } public spawnfakecivs(id) {         format(fakecivnames[0],32,"Bob Thompson")     format(fakecivnames[1],32,"Paul O Connor")     format(fakecivnames[2],32,"Big Smoke")     format(fakecivnames[3],32,"Snoop Dogg")     format(fakecivnames[4],32,"Mr. Woot")     format(fakecivnames[5],32,"Sonni")     format(fakecivnames[6],32,"Dan Ackroid")     format(fakecivnames[7],32,"Fomerly Known as Prince")     format(fakecivnames[8],32,"Cesar Hernadez")     format(fakecivnames[9],32,"Howard Stern")     format(fakecivnames[10],32,"Jack Black")     format(fakecivnames[11],32,"Tom Clancy")     format(fakecivnames[12],32,"Ben Dover")     format(fakecivnames[13],32,"Inspector Gadget")             new i     new fakecivcreateent[14]     for (i=0; i<14; i++ ) {         new fakecivorigin[3]         fakecivorigin[0] = fakecivX[i]         fakecivorigin[1] = fakecivY[i]         fakecivorigin[2] = fakecivZ[i]         new entclassname[14]         format(entclassname[i],16,"fake_civilian%i",i)         fakecivcreateent[i] = create_entity(fakeciv[i])         entity_set_string(fakecivcreateent[i],EV_SZ_classname,entclassname[i]);         entity_set_model(fakecivcreateent[i],"models/barry.mdl");         entity_set_origin(fakecivcreateent[i],fakecivorigin)         DispatchSpawn(fakecivcreateent[i])     }     return PLUGIN_HANDLED } public pfn_touch(ptr,ptd) {     new i     if(ptr < 1 || ptd < 1 || ptd > 32 || !is_user_alive(ptd) || !is_user_connected(ptd)) {         return PLUGIN_CONTINUE;         }      new classname[33];      entity_get_string(ptr,EV_SZ_classname,classname,32);         for (i=0; i<sizeof(fakecivX); i++ ) {             new entclassname[14]             format(entclassname[i],16,"fake_civilian%i",i)                 if(equal(classname,entclassname[i]) == 1) {                     new fakecivphrase[14]                         if (fakecivvoice[i] == 1) {                             format(fakecivphrase[i],64,"%s says, ^"Stop breathing on me!^"",fakecivnames[i])                             client_print(ptd,print_chat,"%s",fakecivphrase)                             client_cmd(ptd,"speak fakeciv/stopbreathingonme.wav")                             return PLUGIN_HANDLED                         }                         if (fakecivvoice[i] == 2) {                             format(fakecivphrase[i],64,"%s says, ^"Back off homie!^"",fakecivnames[i])                             client_print(ptd,print_chat,"%s",fakecivphrase)                             client_cmd(ptd,"speak fakeciv/backhomie.wav")                             return PLUGIN_HANDLED                         }                     }                 }             return PLUGIN_CONTINUE         }                         public plugin_precache() {     precache_sound("fakeciv/backhomie.wav")     precache_sound("fakeciv/stopbreathingonme.wav")     precache_model("models/barry.mdl") }

These 'fakecivs' are not spawning, and it might be somethign with the set_origin because I get a warning of tag mismatch on:

entity_set_origin(fakecivcreateent[i],fakecivorigin)

I made them spawn on a client command as I thought making it execute automatically was the problem... and its not.[/small]

I also made the name assigns in the spawnfakecivs function as it kept going on the fritz when i did new fakecivnames[14] = ("All","The","Names","Etc...")
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 01-29-2005 , 18:53  
Reply With Quote #2

i think a array is made this way:
Code:
new fakecivX[14] = {2959,2753,2129,2129,2129,2006,1064,65,65,-1633,-1633,-2256,-2221,-1568}
with { } NOT ( ) (but it seems that ( ) works too)
also these values should be floats (eg: 2959 -> float = 2959.0)
there it must be also new Float:fakecinX[14]...

Code:
create_entity(fakeciv[i])
what is fakeciv[i] ?
it must be a name
i suggest use
Code:
create_entity("info_target")
also i would not suggest to make checks on clients before u know they are connected
Code:
if(ptr < 1 || ptd < 1 || ptd > 32 || !is_user_alive(ptd) || !is_user_connected(ptd)){
return PLUGIN_CONTINUE
first u check if user is alive then if he is connected
rather do
Code:
if ( ptr < 1 || !is_user_connected(ptd) ){
	return PLUGIN_CONTINUE
}else if ( !is_user_alive(ptd)  )
	return PLUGIN_CONTINUE
u dont need ptd < 1 and ptd >32 as is_user_connected does the same and a bit more
__________________
alias White Panther
karlos is offline
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 01-29-2005 , 19:30   ?
Reply With Quote #3

now i have this...
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> new fakecivX[14] = {2959,2753,2129,2129,2129,2006,1064,65,65,-1633,-1633,-2256,-2221,-1568} new fakecivY[14] = {-515,72,120,120,120,-1849,-2220,-1655,-1655,-89,-89,-1577,-2036,-1431} new fakecivZ[14] = {-284,-264,-252,-252,-252,-172,-252,-284,-284,-268,-268,-292,-236,-284} new fakecivvoice[14] = {1,1,1,2,2,1,2,1,2,2,2,1,1,1} new fakecivnames[14] public plugin_init() {     register_plugin("FakeCiv","0.1","-Snort- Leader")     spawnfakecivs() } public spawnfakecivs() {         format(fakecivnames[0],16,"Bob Thompson")     format(fakecivnames[1],16,"Paul O Connor")     format(fakecivnames[2],16,"Big Smoke")     format(fakecivnames[3],16,"Snoop Dogg")     format(fakecivnames[4],16,"Mr. Woot")     format(fakecivnames[5],16,"Sonni")     format(fakecivnames[6],16,"Dan Ackroid")     format(fakecivnames[7],16,"Fomerly Known as Prince")     format(fakecivnames[8],16,"Cesar Hernadez")     format(fakecivnames[9],16,"Howard Stern")     format(fakecivnames[10],16,"Jack Black")     format(fakecivnames[11],16,"Tom Clancy")     format(fakecivnames[12],16,"Ben Dover")     format(fakecivnames[13],16,"Inspector Gadget")             new i     new fakecivcreateent[14]     for (i=0; i<14; i++ ) {         new Float:fakecivorigin[3];         fakecivorigin[0] = float(fakecivX[i]);         fakecivorigin[1] = float(fakecivY[i]);         fakecivorigin[2] = float(fakecivZ[i]);         new entclassname[14]         format(entclassname[i],16,"fake_civilian%i",i)         fakecivcreateent[i] = create_entity("info_target")         entity_set_string(fakecivcreateent[i],EV_SZ_classname,entclassname[i]);         entity_set_model(fakecivcreateent[i],"models/barry.mdl");         entity_set_origin(fakecivcreateent[i],fakecivorigin)         DispatchSpawn(fakecivcreateent[i])     }     return PLUGIN_HANDLED } public pfn_touch(ptr,ptd) {     new i     if(ptr < 1 || ptd < 1 || ptd > 32 || !is_user_alive(ptd) || !is_user_connected(ptd)) {         return PLUGIN_CONTINUE;         }      new classname[33];      entity_get_string(ptr,EV_SZ_classname,classname,32);         for (i=0; i<sizeof(fakecivX); i++ ) {             new entclassname[14]             format(entclassname[i],16,"fake_civilian%i",i)                 if(equal(classname,entclassname[i]) == 1) {                     new fakecivphrase[14]                         if (fakecivvoice[i] == 1) {                             format(fakecivphrase[i],64,"%s says, ^"Stop breathing on me!^"",fakecivnames[i])                             client_print(ptd,print_chat,"%s",fakecivphrase)                             client_cmd(ptd,"speak fakeciv/stopbreathingonme.wav")                             return PLUGIN_HANDLED                         }                         if (fakecivvoice[i] == 2) {                             format(fakecivphrase[i],64,"%s says, ^"Back off homie!^"",fakecivnames[i])                             client_print(ptd,print_chat,"%s",fakecivphrase)                             client_cmd(ptd,"speak fakeciv/backhomie.wav")                             return PLUGIN_HANDLED                         }                     }                 }             return PLUGIN_CONTINUE         }                         public plugin_precache() {     precache_sound("fakeciv/backhomie.wav")     precache_sound("fakeciv/stopbreathingonme.wav")     precache_model("models/barry.mdl") }

i diddnt change the ptr , ptd thing becuause I couldnt understand what you meant.

This code isnt spawning anything.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 01-29-2005 , 20:07  
Reply With Quote #4

hmmmmmmmmm.... does ED_Allocs: no free adicts mean that I have spawned too many entities at once or that i went over the max entity count?
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
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 19:24.


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