[HELP]Script Errors,Newbie in scripting
#1

Quote:

COMMAND:creategroup(playerid, params[])
{
new string[128];
if(PlayerInfo[playerid][power] >= 12 || PlayerInfo[playerid][helper]>=31337)
{
new iPlayer, iRank[64];
if( sscanf ( params, "us", iPlayer, iRank)) return SCP(playerid, "[PlayerID/PartOfName] [Group Name / No space !]");
if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND);
new groupid = ReturnNextUnusedGroup();
new Float: X = 0.0, Float: Y = 0.0, Float: Z = 0.0;
format(string, sizeof(string), "Groups/%d.ini", groupid);
dini_Create(string);
dini_IntSet(string,"ID",groupid);
dini_Set(string, "Name", iRank);
dini_Set(string, "Leader", PlayerName(iPlayer));
dini_FloatSet(string,"floatx",X);
dini_FloatSet(string,"floaty",Y);
dini_FloatSet(string,"floatz",Z);
PlayerInfo[playerid][pgroupid] = groupid;
return 1;
}
return 1;
}

How can i do it with space,becuase when i use now script it crashes the server please help me :/
[Group Name / No space !]
Reply
#2

I dont clearly understand the first issue and about crash use crash detect and show us what is printing on server log
Reply
#3

I'm sure the crashing of the server is related to the files (not permissions to write or invalid file handle).
If I'm not mistaken, the older version of dini had this issue but it was fixed later. Update the include just to be sure and have crashdetect plugin loaded to get some logs about what caused the crash. Compiling with debug info will also give a more detailed report.

As for ignoring the space, replace with:
pawn Код:
if (sscanf(params, "us[64]{s[64]}", iPlayer, Rank)) return SCP(playerid, "[PlayerID/PartOfName] [Group Name]");
Quite specifiers (wraped with { }) are ingored. The "s" specifier also needs the size specified.

EDIT: I forgot to close square bracket, replaced with {s[64]}
It still works but let keep the correct syntax anyway.
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I'm sure the crashing of the server is related to the files (not permissions to write or invalid file handle).
If I'm not mistaken, the older version of dini had this issue but it was fixed later. Update the include just to be sure and have crashdetect plugin loaded to get some logs about what caused the crash. Compiling with debug info will also give a more detailed report.

As for ignoring the space, replace with:
pawn Код:
if (sscanf(params, "us[64]{s[64}", iPlayer, Rank)) return SCP(playerid, "[PlayerID/PartOfName] [Group Name]");
Quite specifiers (wraped with { }) are ingored. The "s" specifier also needs the size specified.
oki leme try
Reply
#5

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
please specify your error so that we can help you and also about crash use crash detect and show us what is printing on server log
My group system is loading perfectlly but when i use /creategroup 2 Example(if i press space the server crashes)

Example :

/creategroup 2 Example -- in this way dosent crash.

/creategroup 2 Example Example -- in this way crashes.
Reply
#6

Quote:
Originally Posted by LondonRP
Посмотреть сообщение
My group system is loading perfectlly but when i use /creategroup 2 Example(if i press space the server crashes)

Example :

/creategroup 2 Example -- in this way dosent crash.

/creategroup 2 Example Example -- in this way crashes.
ok my laziness i did understand after reading it again and was going to edit my post but konstantinos beat me so just follow him.
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I'm sure the crashing of the server is related to the files (not permissions to write or invalid file handle).
If I'm not mistaken, the older version of dini had this issue but it was fixed later. Update the include just to be sure and have crashdetect plugin loaded to get some logs about what caused the crash. Compiling with debug info will also give a more detailed report.

As for ignoring the space, replace with:
pawn Код:
if (sscanf(params, "us[64]{s[64]}", iPlayer, Rank)) return SCP(playerid, "[PlayerID/PartOfName] [Group Name]");
Quite specifiers (wraped with { }) are ingored. The "s" specifier also needs the size specified.

EDIT: I forgot to close square bracket, replaced with {s[64]}
It still works but let keep the correct syntax anyway.
dosent work
Reply
#8

Quote:
Originally Posted by LondonRP
Посмотреть сообщение
dosent work
please use crash detect to get some information to work on.
Reply
#9

Quote:
Originally Posted by LondonRP
Посмотреть сообщение
dosent work
It should work. What it does is it dumps everything after the space (if found) in iRank.
What version of sscanf are you using? The plugin or the PAWN version?
Reply
#10

Quote:
Originally Posted by Stinged
Посмотреть сообщение
It should work. What it does is it dumps everything after the space (if found) in iRank.
What version of sscanf are you using? The plugin or the PAWN version?
its not crashing but nothing happens
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)