01.06.2013, 17:15
Hello there, I'm a beginner scripter.
I want to make simple, little commands.
It was all-good until THIS error popped up.
Here's my script:
(It has random language in it since I'm hungarian) It has a problem with the returns. It also contains some scripts made by other people, such as the /kocsijavit(Car Fix) or the /kocsi(Car).
Please help, I dunno what the fuq is going on.
I want to make simple, little commands.
It was all-good until THIS error popped up.
Код:
E:\SampServer\gamemodes\VilcsiTHscript.pwn(95) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(102) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(109) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(116) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(123) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(130) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(137) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(144) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(151) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(158) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(165) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(173) : error 079: inconsistent return types (array & non-array) E:\SampServer\gamemodes\VilcsiTHscript.pwn(177) : error 017: undefined symbol "strtok" E:\SampServer\gamemodes\VilcsiTHscript.pwn(177) : error 029: invalid expression, assumed zero E:\SampServer\gamemodes\VilcsiTHscript.pwn(177) : error 017: undefined symbol "string" E:\SampServer\gamemodes\VilcsiTHscript.pwn(177) : fatal error 107: too many error messages on one line
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/oles", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, 0xFF0000FF, "Megpusztultб' he!");
return 1;
}
if (strcmp("/elet", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, 0x00FF00FF, "Цrцk йlet, mi?");
return 1;
}
if (strcmp("/pancel", cmdtext, true, 10) == 0)
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, 0xFFFFFFAA, "Kaptбl pбncйlt kцcsцg.");
return 1;
}
if (strcmp("/felelet", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 50);
SendClientMessage(playerid, 0xFFFF00FF, "Fйl йlet LOL.");
return 1;
}
if (strcmp("/ak", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid, 30, 10000);
SendClientMessage(playerid, 0xFFFF00FF, "Van AK-d kцcsцg! Csak уvatosan!");
return 1;
}
if (strcmp("/minigun", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid, 38, 10000);
SendClientMessage(playerid, 0xFFFF00FF, "Van Minigun-od kцcsцg! Csak уvatosan!");
return 1;
}
if (strcmp("/cshotgun", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid, 27, 10000);
SendClientMessage(playerid, 0xFFFF00FF, "Van Combat Shotgun-od kцcsцg! Csak уvatosan!");
return 1;
}
if (strcmp("/rlauncher", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid, 36, 10000);
SendClientMessage(playerid, 0xFFFF00FF, "Van HS Launcher-ed(Aknavetőd) kцcsцg! Csak уvatosan!");
return 1;
}
if (strcmp("/penz", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x00FF00FF, "Kaptбl pйnzt! Уvatosan a vele!");
GivePlayerMoney(playerid,250000);
return 1;
}
if (strcmp("/grovest", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
SendClientMessage(playerid, 0x007BFFFF, "Elteleportбltбl a Groove Streetre.");
return 1;
}
if(strcmp("/kocsijavit", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid, 0xFFFF00FF, "Egy kocsiban kell lenned hogy hasznбld ezt a parancsot!");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
new string[128];
format(string, sizeof(string), "Megjavнtottad kocsi ID-t: %d.", vehicleid);
SendClientMessage(playerid, 0xFFFF00FF, string);
RepairVehicle(vehicleid);
return 1;
}
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;
}
if(strcmp("/kocsi", cmdtext, true, 10) == 0)
}
new tmp[256], tmp2[256], tmp3[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
tmp3 = strtok(cmdtext, idx);
new model = strval(tmp);
new color1 = strval(tmp2);
new color2 = strval(tmp3);
if(!strlen(tmp)){
SendClientMessage(playerid, 0xFF0000FF, "Hasznбlat: /kocsi [kocsiid] [elsőszнnid] [mбsodikszнn]");
return 1;
}
if(!strlen(tmp2)){
SendClientMessage(playerid, 0xFF0000FF, "Hasznбlat: /kocsi [kocsiid] [elsőszнnid] [mбsodikszнn]");
return 1;
}
if(!strlen(tmp3)){
SendClientMessage(playerid, 0xFF0000FF, "Hasznбlat: /kocsi [kocsiid] [elsőszнnid] [mбsodikszнn]");
return 1;
}
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(model, x, y+2, z+1, a, color1, color2, -1);
new string[128];
format(string, sizeof(string), "Leraktбl egy %d -t első szнn: %d йs mбsodik szнn: %d.", model, color1, color2);
SendClientMessage(playerid, 0xFFFF00FF, string);
return 1;
}
return 0;
}
Please help, I dunno what the fuq is going on.



