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:
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...")