Commands being spaxed
#1

hiya, i got these two commands... /teleports and /teleports2
/teleports works fine.. but /teleports2 dose exactly the same thing as /teleports.. here is the code.. can you see anything wrong? i cant

Код:
	if (strcmp("/teleports", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "TELEPORTS");
		SendClientMessage(playerid, COLOR_GREEN, "STUNT: /stunt /stunt2 /stunt3 /stunt4 /stunt5 /stunt6 /dam /oilfarm /area51");
		SendClientMessage(playerid, COLOR_GREEN, "BIGJUMP: /bigjump /bigjump2 /bigjump3 /bigjump4 /diamondjump /pipedrop /pipedrop2");
		SendClientMessage(playerid, COLOR_GREEN, "DRIFTS: /drift /drift2 /drift3 /drift4");
		SendClientMessage(playerid, COLOR_GREEN, "WATER: /boatstunt /dinghystunt /kartboatstunt /waterairport /docks /flood /underwater");
		SendClientMessage(playerid, COLOR_GREEN, "TUNING: /tuning /tuning2 /tuning3");
		SendClientMessage(playerid, COLOR_GREEN, "AIRPORT: /airport /airport2 /airport3 /airport4");
 		SendClientMessage(playerid, COLOR_GREY, "MORE TELEPORTS AT: /teleports2");
		return 1;
 	}
	if (strcmp("/teleport2", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "TELEPORTS 2");
		SendClientMessage(playerid, COLOR_GREEN, "RACING: /smash /kartrace /chilliad /dumperrace /monstersmash /cars");
		SendClientMessage(playerid, COLOR_GREEN, "RACING2: /quadtrack /bumpercars");
		SendClientMessage(playerid, COLOR_GREEN, "OFFROAD: /offroad /offroad2 /lostisland");
		SendClientMessage(playerid, COLOR_GREEN, "PARKOUR: /parkour /parkour2");
		SendClientMessage(playerid, COLOR_GREEN, "MISC: /oilcoaster /dunes /skydive /skydive2 /quarry /train /poolparty");
		SendClientMessage(playerid, COLOR_GREEN, "MISC2: /maze /abandonedtown /farm /bombcage /treehouse /trucks /cjhouse");
		SendClientMessage(playerid, COLOR_GREY, "NEW:>>> /offroad4 /offroad3 /streetrace");
		return 1;
 	}
pls help xD
Reply
#2

pawn Код:
if (strcmp("/teleports", cmdtext, true, 10) == 0)
Remove that 10. Do it with both commands. If you have 10 there, it will only check 10 first characters in the command you typed.

pawn Код:
if (strcmp("/teleports", cmdtext, true) == 0)
Reply
#3

Since you are checking for a specific length, typing "/teleports2", which is 11 letters, will return the code for "/teleports", as the code searches for "/teleports" in the first 10 characters of the string.

To simplify this answer, type "/teleport2", as is the command you've made, rather than "/teleports2".
Reply
#4

oh xD never knew that lol srry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)