PDA

View Full Version : NEED help when am running a command!


Satish1
30/07/2018, 07:07 PM
07/30/18 15:01:51 [join] Rockie has joined the server (4:41.212.151.249)
07/30/18 15:03:51 RCON (In-Game): Player #4 (Rockie) has logged in.
07/30/18 15:03:58 [debug] Run time error 10: "Native function failed"
07/30/18 15:03:58 [debug] AMX backtrace:
07/30/18 15:03:58 [debug] #0 007b9588 in public pc_cmd_screate (4, 25494680) from b9.amx

Can someone help me fixing that error? It occurs everytime When I create my stores /screate SOTRE_TYPE_BANK Name.

And now I have to enter it Manually into the SQL Can someone help me regarding this please?

Thanks,
Regards

GRiMMREAPER
30/07/2018, 07:10 PM
Show us the /screate command.

Satish1
31/07/2018, 03:00 PM
How will I show you it lol?

Anyone help???

AndreProgrammer
31/07/2018, 03:02 PM
Show the command. I don't know what is the code

Satish1
31/07/2018, 04:01 PM
CMD:screate(playerid, params[])
{
if(!IsPlayerAdmin(playerid) || PlayerData[playerid][e_level] != MAX_ADMIN_LEVEL)
{
return SCM(playerid, -1, NO_PERM);
}

new type;
if(sscanf(params, "is[143]", type, gstr))
{
SCM(playerid, NEF_GREEN, "STORE_TYPE_AMMUNATION, STORE_TYPE_BANK, STORE_TYPE_BURGERSHOT, STORE_TYPE_CLUCKINBELLS, STORE_TYPE_247, STORE_TYPE_STACKEDPIZZAS");
return SCM(playerid, NEF_GREEN, "Usage: /screate <type> <name>");
}

if(type < 0 || type > 6)
return SCM(playerid, -1, ""er"Invalid store type");

if(strlen(gstr) < 3 || strlen(gstr) > MAX_STORE_NAME)
return SCM(playerid, -1, ""er"Invalid store name length");

new count = 0;
for(new i = 0; i < MAX_STORES; i++) {
if(StoreData[i][e_ormid] != ORM:-1)
++count;
}

if(count >= MAX_STORES)
return SCM(playerid, -1, ""er"Max stores reached");

new r = -1;
for(new i = 0; i < MAX_STORES; i++) {
if(StoreData[i][e_ormid] == ORM:-1) {
r = i;
break;
}
}

if(r == -1) return SCM(playerid, -1, ""er"No free store slot");

new ORM:ormid = StoreData[r][e_ormid] = orm_create("stores"),
Float:fPOS[4];

AssembleStoreORM(ormid, r);

GetPlayerPos(playerid, fPOS[0], fPOS[1], fPOS[2]);
GetPlayerFacingAngle(playerid, fPOS[3]);

StoreData[r][e_pick][0] = fPOS[0];
StoreData[r][e_pick][1] = fPOS[1];
StoreData[r][e_pick][2] = fPOS[2];

GetPosInFrontOfPlayer(playerid, fPOS[0], fPOS[1], -2.5);
StoreData[r][e_spawn][0] = fPOS[0];
StoreData[r][e_spawn][1] = fPOS[1];
StoreData[r][e_spawn][2] = fPOS[2];
StoreData[r][e_spawn][3] = floatround(floatadd(180.0, fPOS[3]), floatround_ceil);

StoreData[r][e_type] = E_STORE_TYPE:type;
StoreData[r][e_date] = gettime();
StoreData[r][e_creator] = PlayerData[playerid][e_accountid];
strcpy2(StoreData[r][e_name], gstr, MAX_STORE_NAME);

orm_setkey(ormid, "id");
orm_insert(ormid, "OnStoreLoadEx", "i", r);
return 1;
}

Satish1
31/07/2018, 04:43 PM
Shown the cmd!

Satish1
01/08/2018, 08:57 AM
BUMP please help me?

Satish1
01/08/2018, 06:09 PM
BUMP

Rufio
02/08/2018, 01:59 AM
Instead of bumping, use [ pawn] tag without the space. Your code is a massive pain to read.

Satish1
13/08/2018, 03:38 PM
CMD:screate(playerid, params[])
{
if(!IsPlayerAdmin(playerid) || PlayerData[playerid][e_level] != MAX_ADMIN_LEVEL)
{
return SCM(playerid, -1, NO_PERM);
}

new type;
if(sscanf(params, "is[143]", type, gstr))
{
SCM(playerid, NEF_GREEN, "STORE_TYPE_AMMUNATION, STORE_TYPE_BANK, STORE_TYPE_BURGERSHOT, STORE_TYPE_CLUCKINBELLS, STORE_TYPE_247, STORE_TYPE_STACKEDPIZZAS");
return SCM(playerid, NEF_GREEN, "Usage: /screate <type> <name>");
}

if(type < 0 || type > 6)
return SCM(playerid, -1, ""er"Invalid store type");

if(strlen(gstr) < 3 || strlen(gstr) > MAX_STORE_NAME)
return SCM(playerid, -1, ""er"Invalid store name length");

new count = 0;
for(new i = 0; i < MAX_STORES; i++) {
if(StoreData[i][e_ormid] != ORM:-1)
++count;
}

if(count >= MAX_STORES)
return SCM(playerid, -1, ""er"Max stores reached");

new r = -1;
for(new i = 0; i < MAX_STORES; i++) {
if(StoreData[i][e_ormid] == ORM:-1) {
r = i;
break;
}
}

if(r == -1) return SCM(playerid, -1, ""er"No free store slot");

new ORM:ormid = StoreData[r][e_ormid] = orm_create("stores"),
Float:fPOS[4];

AssembleStoreORM(ormid, r);

GetPlayerPos(playerid, fPOS[0], fPOS[1], fPOS[2]);
GetPlayerFacingAngle(playerid, fPOS[3]);

StoreData[r][e_pick][0] = fPOS[0];
StoreData[r][e_pick][1] = fPOS[1];
StoreData[r][e_pick][2] = fPOS[2];

GetPosInFrontOfPlayer(playerid, fPOS[0], fPOS[1], -2.5);
StoreData[r][e_spawn][0] = fPOS[0];
StoreData[r][e_spawn][1] = fPOS[1];
StoreData[r][e_spawn][2] = fPOS[2];
StoreData[r][e_spawn][3] = floatround(floatadd(180.0, fPOS[3]), floatround_ceil);

StoreData[r][e_type] = E_STORE_TYPE:type;
StoreData[r][e_date] = gettime();
StoreData[r][e_creator] = PlayerData[playerid][e_accountid];
strcpy2(StoreData[r][e_name], gstr, MAX_STORE_NAME);

orm_setkey(ormid, "id");
orm_insert(ormid, "OnStoreLoadEx", "i", r);
return 1;
}

Satish1
13/08/2018, 03:41 PM
Anyone help me?

Sew_Sumi
13/08/2018, 04:09 PM
Now hold on, Why are you all actually asking for the command, when you need the log to help them...

We'll just look at a 50 line command, and search for the failed function, when in the startup log, it's highly likely that the missing plugin will even be listed.


OP post the server log for a server startup. server.cfg could also help, just remove the IPs/Passwords from the log and the cfg.

Satish1
13/08/2018, 05:31 PM
07/30/18 15:01:51 [join] Rockie has joined the server (4:41.212.151.249)
07/30/18 15:03:51 RCON (In-Game): Player #4 (Rockie) has logged in.
07/30/18 15:03:58 [debug] Run time error 10: "Native function failed"
07/30/18 15:03:58 [debug] AMX backtrace:
07/30/18 15:03:58 [debug] #0 007b9588 in public pc_cmd_screate (4, 25494680) from b9.amx

Sew_Sumi
13/08/2018, 10:51 PM
That's not what I asked for...


Not just a snippet of the log... I want the entire thing, for a start to shutdown, as the STARTUP is what I'm wanting to see... Not just the end, where you think the error is coming from. (Even though, I still want more of the end as well. Everything helps.

After all, even that return that you posted, there's about 10 lines under that.



Post up your server.cfg (Minus IPs/Passwords), and the log itself.(Again minus IPs (Protect yourself and your users))