Hey,
warum bekomme ich hier dauernd "Unknown Command".. ?
Ich wüsste nicht, was am Code falsch ist
new tmp[256], cmd[256], idx;
cmd = strtok(cmdtext, idx);
if (strcmp(cmd, "/rnpc", true, 10) == 0)
{
tmp = strtok(cmdtext,idx);
if(!tmp[0]) return SendClientMessage(playerid,-1,"/rnpc [create/delete]");
new rn_type[15];
format(rn_type,15,tmp);
if(strcmp(rn_type,"create",true,10)==0)
{
new rnpc_name[24];
new Float:x,Float:y,Float:z;
new id = ConnectRNPC("rnpc_22449902");
format(rnpc_name,24,"rnpc_%i",id);
SetPlayerName(id,rnpc_name);
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(id,x,y,z+10);
return 1;
}
if(strcmp(rn_type,"delete",true,10)==0)
{
tmp = strtok(cmdtext,idx);
if(!tmp[0]) return SendClientMessage(playerid,-1,"/rnpc delete [ID]");
new rnpc_del_id = strval(tmp);
return Kick(rnpc_del_id);
}
return 1;
}