CMD:createactor(playerid,params[]) {
new actorName[24],skin;
if(sscanf(params,"is[24]",skin,actorName)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /createactor [skinid] [name] ");
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
sql_CreateActor(actorName, skin, x,y,z,a, animlib, animname);
new string[128];
format(string,sizeof(string), "New actor created. Skin ID: %i Name: %s. Type /reloadactors to reload all actors",skin,actorName);
SendClientMessage(playerid,COLOR_GREY,string);
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/createactor"))
{
new actorName[24],skin;
if(sscanf(params,"is[24]",skin,actorName)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /createactor [skinid] [name] ");
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
sql_CreateActor(actorName, skin, x,y,z,a, animlib, animname);
new string[128];
format(string,sizeof(string), "New actor created. Skin ID: %i Name: %s. Type /reloadactors to reload all actors",skin,actorName);
SendClientMessage(playerid,COLOR_GREY,string);
return 1;
}
return 0;
}
if(strcmp(cmd, "/createactor", true) == 0)
{
new actorName[24],skin;
if(sscanf(params,"is[24]",skin,actorName)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /createactor [skinid] [name] ");
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
sql_CreateActor(actorName, skin, x,y,z,a, animlib, animname);
new string[128];
format(string,sizeof(string), "New actor created. Skin ID: %i Name: %s. Type /reloadactors to reload all actors",skin,actorName);
SendClientMessage(playerid,COLOR_GREY,string);
return 1;
}
error 017: undefined symbol "params"
if(strcmp(cmd, "/createactor", true) == 0)
{
new actorName[24],skin;
if(sscanf(cmd[13],"is[24]",skin,actorName)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /createactor [skinid] [name] ");
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
sql_CreateActor(actorName, skin, x,y,z,a, animlib, animname);
new string[128];
format(string,sizeof(string), "New actor created. Skin ID: %i Name: %s. Type /reloadactors to reload all actors",skin,actorName);
SendClientMessage(playerid,COLOR_GREY,string);
return 1;
}
PHP код:
|