Floor Teleporting - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Floor Teleporting (
/showthread.php?tid=127324)
Floor Teleporting -
adsy - 12.02.2010
I am looking to make a strcmp teleport code and im stuck on 1 bit.
the actual bit that teleports
heres the code
Code:
if(strcmp(cmd, "/floor", true, 6) == 0) {
if(GetPlayerVirtualWorld(playerid) == 1) {
for(new i=0; i<sizeof(CarParkFloor); i++) {
if(IsPlayerInRangeOfPoint(playerid, 2.0, CarParkFloor[i][0], CarParkFloor[i][1], CarParkFloor[i][2])) {
new tmp[32];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /floor [1-10]");
new iValue = strval(tmp);
if(iValue == i) {
SetPlayerPos(playerid, CarParkFloor[i][0]-2, CarParkFloor[i][1], CarParkFloor[i][2]);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
}
}
}
}
else return SendClientMessage(playerid, 0xFF0000FF, "You cannot use this command at this time.");
}
this line here i created myself assuming it would work:
if(iValue == i) {
but it doesnt.
This is the crucial line that makes it teleport but it doesnt, i ran an else on that bit and no matter what i put in, thats what it came out with.
can someone help?