getting undefined errors....
#1

here's the errors:-

Quote:

C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(742) : error 017: undefined symbol "cmd"
C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(747) : error 017: undefined symbol "strtok"
C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(747) : error 033: array must be indexed (variable "tmp")
C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(756) : error 017: undefined symbol "strtok"
C:\Users\Aman\Desktop\GTA\its a server\windows\gamemodes\elitedrift.pwn(756) : error 033: array must be indexed (variable "tmp")

and heres the code it self :-

Quote:

if(strcmp(cmd, "/cc", true) == 0)
{
new tmp[256];
new co1;
new co2;
tmp = strtok(cmdtext, idx);

if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "ERROR: /cc [ID1] [ID2]");
return 1;
}
co1 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid), co1, co1);
tmp = strtok(cmdtext, idx);

if(!strlen(tmp))
{
ChangeVehicleColor(GetPlayerVehicleID(playerid), co1, co1);
return 1;
}
co2 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid), co1, co2);
return 1;
}

Reply
#2

I guess this link will help you.
https://sampforum.blast.hk/showthread.php?tid=199796
Reply
#3

Quote:
Originally Posted by varthshenon
View Post
How would it help him ?, he used Copy + Paste.
Reply
#4

Quote:
Originally Posted by BATAD
View Post
How would it help him ?, he used Copy + Paste.
By learning how to use strcmp for OnPlayerCommandText.
Reply
#5

i put this under the /cc command but then i get 12 errors :/

Quote:

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;
}

Reply
#6

Quote:
Originally Posted by [EDT]AmanSingh123
View Post
i put this under the /cc command but then i get 12 errors :/
Its [pawn] not [quote], and You shouldn't post it under the /cc command.

https://sampwiki.blast.hk/wiki/Strtok This should help ya.
Reply
#7

oh wait, i did it works perfectly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)