11.05.2015, 12:54
On CheckEnter(),when using /enter it will only work nearby the bizes,houses,teleports(this),so im modified the script to work for everybody!
Earlier it was with gFaction but it didn't have any error so i have removed that!
This is how it was before i removed gFaction things
Earlier it was with gFaction but it didn't have any error so i have removed that!
This is how it was before i removed gFaction things
Код:
COMMAND:use(playerid) { for(new h=0; h<=MAX_TELEPORTS; h++) { if(IsPlayerInRangeOfPoint(playerid, 1, TeleportInfo[h][gstartCX], TeleportInfo[h][gstartCY], TeleportInfo[h][gstartCZ])) { if(TeleportInfo[h][gFaction] == 255) { new file[64]; format(file,sizeof(file),"teleports/teleport%d.txt",h); new Float: X, Float: Y, Float: Z; X = dini_Float(file,"endfloatx"); Y = dini_Float(file,"endfloaty"); Z = dini_Float(file,"endfloatz"); new Q = dini_Int(file,"virtualworld"); new W = dini_Int(file,"interior"); SetPlayerVirtualWorld(playerid,Q); SetPlayerInterior(playerid,W); SetPlayerPos(playerid,X,Y,Z); SendClientInfo(playerid, "Done, Good day ! "); } else { if(PlayerInfo[playerid][playerteam]==TeleportInfo[h][gFaction]) { new file[64]; format(file,sizeof(file),"teleports/teleport%d.txt",h); new Float: X, Float: Y, Float: Z; X = dini_Float(file,"endfloatx"); Y = dini_Float(file,"endfloaty"); Z = dini_Float(file,"endfloatz"); new Q = dini_Int(file,"endvirtualworld"); new W = dini_Int(file,"endinterior"); SetPlayerVirtualWorld(playerid,Q); SetPlayerInterior(playerid,W); SetPlayerPos(playerid,X,Y,Z); SendClientInfo(playerid, "Done, Good day ! "); } else { SendClientError(playerid,"Invalid Faction!"); } } } else { new filee[64]; format(filee,sizeof(filee),"teleports/teleport%d.txt",h); new Float: XX, Float: YY, Float: ZZ; XX = dini_Float(filee,"endfloatx"); YY = dini_Float(filee,"endfloaty"); ZZ = dini_Float(filee,"endfloatz"); if(IsPlayerInRangeOfPoint(playerid,1, XX,YY,ZZ)) { if(TeleportInfo[h][gFaction] == 255) { new file[64]; format(file,sizeof(file),"teleports/teleport%d.txt",h); new Float: X, Float: Y, Float: Z; X = dini_Float(file,"startfloatx"); Y = dini_Float(file,"startfloaty"); Z = dini_Float(file,"startfloatz"); new Q = dini_Int(file,"startvirtualworld"); new W = dini_Int(file,"startinterior"); SetPlayerVirtualWorld(playerid,Q); SetPlayerInterior(playerid,W); SetPlayerPos(playerid,X,Y,Z); SendClientInfo(playerid, "Done, Good day ! "); } else { if(PlayerInfo[playerid][playerteam]==TeleportInfo[h][gFaction]) { new file[64]; format(file,sizeof(file),"teleports/teleport%d.txt",h); new Float: X, Float: Y, Float: Z; X = dini_Float(file,"startfloatx"); Y = dini_Float(file,"startfloaty"); Z = dini_Float(file,"startfloatz"); new Q = dini_Int(file,"startvirtualworld"); new W = dini_Int(file,"startinterior"); SetPlayerVirtualWorld(playerid,Q); SetPlayerInterior(playerid,W); SetPlayerPos(playerid,X,Y,Z); SendClientInfo(playerid, "Done, Good day ! "); } else { SendClientError(playerid,"Invalid Faction!"); } } } } } return 1; }