-
Sziasztok!
Ismerõsöm kölcsön adta a módját hogy kimásoljam belõle a /carcolor-t de errorozik a pawno :dodge:
#include <a_samp>
#define COLOR_YELLOW 0xFFFF00AA
#if defined FILTERSCRIPT
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, \"/carcolor\", true) == 0)
{
new color1, color2;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, \"Usd be: /carcolor [color1] [color2]\");
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, \"Usd be: /carcolor [color1] [color2]\");
color2 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
return 1;
}
return 0;
}
ugyan így van nála is de itt ezeket az errorokat írja:
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(9) : error 017: undefined symbol \"strtok\"
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(9) : error 033: array must be indexed (variable \"cmd\")
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(14) : error 017: undefined symbol \"strtok\"
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(14) : error 033: array must be indexed (variable \"tmp\")
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(17) : error 017: undefined symbol \"strtok\"
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(17) : error 033: array must be indexed (variable \"tmp\")
bármit beakarok rakni amiben van olyan hogy strtok pl: givecash akkor ilyesmi errorokat ír :mistrust:
Meg a DM-ekkel is van problémám azokra is errort ír azt pedig a régi modeombol másolom ki mert újat csináltam és ott még mûködik... pls valaki help :-\\
-
Valószínû a haverod másik PAWNO verziót használ.De nem fix.
-
neem.. ugyan az a verzió és elmentem az övét és nem errorozik
-
new tmp[128], cmd[128];
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Bemásolod és jó lesz
-
Sajna nem jó ez se :( 4 error
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(8) : warning 217: loose indentation
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(8) : error 017: undefined symbol \"strtok\"
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(8) : error 029: invalid expression, assumed zero
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(8) : error 017: undefined symbol \"string\"
C:\\Documents and Settings\\Ákos\\Asztal\\carcolor1.pwn(8) : fatal error 107: too many error messages on one line
-
Másold be valahova ezt:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Ne public-hoz! Ez különálló rész.
-
new color1, color2;
CMD:carcolor(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,\"Nem vagy jármûben!\");
else if(sscanf(params, \"dd\", color1, color2)) return SendClientMessage(playerid, 0xFF0000FF, \"HASZNÁLAT: /carcolor [szín1] [szín2]\");
else return ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
}
sscanf letöltése
zcmd letöltése
-
Köszönöm szépen! 8)