Hi i just finished up a very easy script for a new server name Cobyri
http://pastebin.com/a0C9rJJQ
Tell me what you think please tell me how i could improve and yes this is a very simple script.waiting for johns pro tutorial to come out
Hi i just finished up a very easy script for a new server name Cobyri
http://pastebin.com/a0C9rJJQ
Tell me what you think please tell me how i could improve and yes this is a very simple script.waiting for johns pro tutorial to come out
Noof was here.
You still work for Xadis?
Well, it won't work in general...
Here's your script:
As you can see, the if statements are outside the function, so it's supposed to be:PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
if(player.chat == "/hug"){
setani("grab", null);
}
if(player.chat == "/Dance") {
player.dir = 2;
setani("dance",null);
}
}
if(player.chat == "/sit") {
setani("sit",null);
}
if(player.chat == "/run") {
setani("walk",null);
}
if(player.chat == "/jump") {
setani("jump",null);
}
if(player.chat == "/omg") {
setani("omg",null);
}
But also, it's way too many if statements, using switch()case() is better:PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
if(player.chat == "/hug"){
setani("grab", null);
}
if(player.chat == "/Dance") {
player.dir = 2;
setani("dance",null);
}
if(player.chat == "/sit") {
setani("sit",null);
}
if(player.chat == "/run") {
setani("walk",null);
}
if(player.chat == "/jump") {
setani("jump",null);
}
if(player.chat == "/omg") {
setani("omg",null);
}
}
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
switch(player.chat) {
case "hug":
setani("grab", null);
break;
case "/dance":
player.dir = 2;
setani("dance",null);
break;
case "/sit":
setani("sit",null);
break;
case "/run":
setani("walk",null);
break;
case "/jump":
setani("jump",null);
break;
case "/omg":
setani("omg",null);
break;
}
}
-Johnaudi
Can you explain what you did from here
//#CLIENTSIDE
function onPlayerChats() {
if(player.chat == "/hug"){
setani("grab", null);
}
if(player.chat == "/Dance") {
player.dir = 2;
setani("dance",null);
}
}
if(player.chat == "/sit") {
setani("sit",null);
}
if(player.chat == "/run") {
setani("walk",null);
}
if(player.chat == "/jump") {
setani("jump",null);
}
if(player.chat == "/omg") {
setani("omg",null);
}
to
//#CLIENTSIDE
function onPlayerChats() {
if(player.chat == "/hug"){
setani("grab", null);
}
if(player.chat == "/Dance") {
player.dir = 2;
setani("dance",null);
}
if(player.chat == "/sit") {
setani("sit",null);
}
if(player.chat == "/run") {
setani("walk",null);
}
if(player.chat == "/jump") {
setani("jump",null);
}
if(player.chat == "/omg") {
setani("omg",null);
}
}
and how do you make it a php code? thanks
Noof was here.
Use the PHP quotes:
HTML Code:[PHP] script here [/PHP]
-Johnaudi